e73163
diff -up sqlite-3.6.23/tool/lemon.c.system-template sqlite-3.6.23/tool/lemon.c
e73163
--- sqlite-3.6.23/tool/lemon.c.system-template	2010-03-10 16:40:35.000000000 +0200
e73163
+++ sqlite-3.6.23/tool/lemon.c	2010-03-10 16:40:39.000000000 +0200
e73163
@@ -3106,6 +3106,8 @@ PRIVATE FILE *tplt_open(struct lemon *le
e73163
     tpltname = buf;
e73163
   }else if( access(templatename,004)==0 ){
e73163
     tpltname = templatename;
e73163
+  }else if( access("/usr/share/lemon/lempar.c", R_OK)==0){
e73163
+    tpltname = "/usr/share/lemon/lempar.c";
e73163
   }else{
e73163
     tpltname = pathsearch(lemp->argv0,templatename,0);
e73163
   }
e73163
@@ -3117,7 +3119,7 @@ PRIVATE FILE *tplt_open(struct lemon *le
e73163
   }
e73163
   in = fopen(tpltname,"rb");
e73163
   if( in==0 ){
e73163
-    fprintf(stderr,"Can't open the template file \"%s\".\n",templatename);
e73163
+    fprintf(stderr,"Can't open the template file \"%s\".\n",tpltname);
e73163
     lemp->errorcnt++;
e73163
     return 0;
e73163
   }