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