mirror of
https://github.com/gophernicus/gophernicus.git
synced 2025-02-02 15:08:00 -05:00
Merge pull request #68 from augfab/fixes
Always close file pointer and propagate CFLAGS/LDFLAGS to recursive MAKE calls
This commit is contained in:
commit
f797d7192e
6
Makefile
6
Makefile
@ -46,12 +46,12 @@ IPCRM = /usr/bin/ipcrm
|
|||||||
all:
|
all:
|
||||||
@case $$(uname) in \
|
@case $$(uname) in \
|
||||||
Darwin) $(MAKE) ROOT="$(OSXROOT)" DESTDIR="$(OSXDIr)" src/$(BINARY); ;; \
|
Darwin) $(MAKE) ROOT="$(OSXROOT)" DESTDIR="$(OSXDIr)" src/$(BINARY); ;; \
|
||||||
Haiku) $(MAKE) LDFLAGS="-lnetwork" src/$(BINARY); ;; \
|
Haiku) $(MAKE) LDFLAGS="$(LDFLAGS) -lnetwork" src/$(BINARY); ;; \
|
||||||
*) if [ -f "/usr/include/tcpd.h" ]; then $(MAKE) withwrap; else $(MAKE) src/$(BINARY); fi; ;; \
|
*) if [ -f "/usr/include/tcpd.h" ]; then $(MAKE) withwrap; else $(MAKE) src/$(BINARY); fi; ;; \
|
||||||
esac
|
esac
|
||||||
|
|
||||||
withwrap:
|
withwrap:
|
||||||
$(MAKE) CFLAGS="-DHAVE_LIBWRAP" LDFLAGS="-lwrap" src/$(BINARY)
|
$(MAKE) CFLAGS="$(CFLAGS) -DHAVE_LIBWRAP" LDFLAGS="$(LDFLAGS) -lwrap" src/$(BINARY)
|
||||||
|
|
||||||
deb:
|
deb:
|
||||||
dpkg-buildpackage -rfakeroot -uc -us
|
dpkg-buildpackage -rfakeroot -uc -us
|
||||||
@ -72,7 +72,7 @@ src/functions.h:
|
|||||||
grep -h "^[a-z]" $(SOURCES) | \
|
grep -h "^[a-z]" $(SOURCES) | \
|
||||||
grep -v "int main" | \
|
grep -v "int main" | \
|
||||||
grep -v "strlc" | \
|
grep -v "strlc" | \
|
||||||
grep -v "[a-z]:" | \
|
grep -vi "[a-z]:" | \
|
||||||
sed -e "s/ =.*$$//" -e "s/ *$$/;/" >> $@
|
sed -e "s/ =.*$$//" -e "s/ *$$/;/" >> $@
|
||||||
@echo
|
@echo
|
||||||
|
|
||||||
|
14
src/menu.c
14
src/menu.c
@ -283,6 +283,7 @@ int gophermap(state *st, char *mapfile, int depth)
|
|||||||
char type;
|
char type;
|
||||||
int port;
|
int port;
|
||||||
int exe;
|
int exe;
|
||||||
|
int return_val = QUIT;
|
||||||
|
|
||||||
/* Prevent include loops */
|
/* Prevent include loops */
|
||||||
if (depth > 4) return OK;
|
if (depth > 4) return OK;
|
||||||
@ -343,8 +344,13 @@ int gophermap(state *st, char *mapfile, int depth)
|
|||||||
if (type == '#') continue;
|
if (type == '#') continue;
|
||||||
|
|
||||||
/* Stop handling gophermap? */
|
/* Stop handling gophermap? */
|
||||||
if (type == '*') return OK;
|
if (type == '*') {
|
||||||
if (type == '.') return QUIT;
|
return_val = OK;
|
||||||
|
goto CLOSE_FP;
|
||||||
|
}
|
||||||
|
if (type == '.')
|
||||||
|
goto CLOSE_FP;
|
||||||
|
|
||||||
|
|
||||||
/* Print a list of users with public_gopher */
|
/* Print a list of users with public_gopher */
|
||||||
if (type == '~' && st->opt_personal_spaces) {
|
if (type == '~' && st->opt_personal_spaces) {
|
||||||
@ -435,14 +441,14 @@ int gophermap(state *st, char *mapfile, int depth)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Clean up & return */
|
CLOSE_FP:
|
||||||
#ifdef HAVE_POPEN
|
#ifdef HAVE_POPEN
|
||||||
if (exe & st->opt_exec) pclose(fp);
|
if (exe & st->opt_exec) pclose(fp);
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
|
|
||||||
return QUIT;
|
return return_val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user