[hackers] [ubase] Properly signal failure if command fails in ubase-box || sin
commit 6e3c035db8d35e9c5bc916af6d303775d2780830
Author: sin <sin_AT_2f30.org>
Date: Mon Nov 10 23:36:44 2014 +0000
Properly signal failure if command fails in ubase-box
Similar fix as the one provided by emg for sbase.
diff --git a/Makefile b/Makefile
index f172c7c..d267535 100644
--- a/Makefile
+++ b/Makefile
_AT_@ -210,7 +210,7 @@ ubase-box: config.h $(SRC) util.a
_AT_echo '#include "util.h"' >> build/$@.c
_AT_for f in $(SRC); do echo "int `basename $$f .c`_main(int, char **);" >> build/$@.c; done
_AT_echo 'int main(int argc, char *argv[]) { char *s = basename(argv[0]); if(!strcmp(s,"ubase-box")) { argc--; argv++; s = basename(argv[0]); } if(0) ;' >> build/$@.c
- _AT_for f in $(SRC); do echo "else if(!strcmp(s, \"`basename $$f .c`\")) `basename $$f .c`_main(argc, argv);" >> build/$@.c; done
+ _AT_for f in $(SRC); do echo "else if(!strcmp(s, \"`basename $$f .c`\")) return `basename $$f .c`_main(argc, argv);" >> build/$@.c; done
_AT_echo 'else {' >> build/$@.c
_AT_for f in $(SRC); do echo "printf(\"`basename $$f .c`\"); putchar(' ');" >> build/$@.c; done
_AT_echo "putchar(0xa); }; return 0; }" >> build/$@.c
Received on Tue Nov 11 2014 - 00:40:06 CET
This archive was generated by hypermail 2.3.0
: Tue Nov 11 2014 - 00:48:10 CET