Files
MSYS2-packages/lemon/0010-lemon-share.patch
2014-10-10 21:56:54 -04:00

32 lines
892 B
Diff

--- lemon.c.orig 2014-10-09 19:54:58.222526500 -0400
+++ lemon.c 2014-10-09 19:56:09.104567300 -0400
@@ -3244,6 +3244,10 @@
tpltname = pathsearch(lemp->argv0,templatename,0);
}
if( tpltname==0 ){
+ sprintf(buf,"/usr/share/lemon/%s",templatename);
+ tpltname = buf;
+ }
+ if( tpltname==0 ){
fprintf(stderr,"Can't find the parser driver template file \"%s\".\n",
templatename);
lemp->errorcnt++;
@@ -3251,9 +3255,14 @@
}
in = fopen(tpltname,"rb");
if( in==0 ){
- fprintf(stderr,"Can't open the template file \"%s\".\n",templatename);
- lemp->errorcnt++;
- return 0;
+ sprintf(buf,"/usr/share/lemon/%s",templatename);
+ tpltname = buf;
+ in = fopen(tpltname,"rb");
+ if( in==0 ){
+ fprintf(stderr,"Can't open the template file \"%s\".\n",tpltname);
+ lemp->errorcnt++;
+ return 0;
+ }
}
return in;
}