1
0
mirror of https://github.com/gophernicus/gophernicus.git synced 2024-12-04 14:46:37 -05:00

Fix for executable gophermaps in directories with spaces (bugreport from Black Rider)

This commit is contained in:
Kim Holviala 2015-09-23 19:01:22 +03:00
parent 42eb76376c
commit 1e5328f159

7
menu.c
View File

@ -269,6 +269,9 @@ int gophermap(state *st, char *mapfile, int depth)
FILE *fp;
struct stat file;
char line[BUFSIZE];
#ifdef HAVE_POPEN
char buf[BUFSIZE];
#endif
char *selector;
char *name;
char *host;
@ -299,7 +302,9 @@ int gophermap(state *st, char *mapfile, int depth)
#ifdef HAVE_POPEN
if (exe) {
setenv_cgi(st, mapfile);
if ((fp = popen(mapfile, "r")) == NULL) return OK;
snprintf(buf, sizeof(buf), "'%s'", mapfile);
if ((fp = popen(buf, "r")) == NULL) return OK;
}
else
#endif