From 4c2bd6277d5966ea7ef7d59a34838066b5c130eb Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Mon, 5 May 2014 21:20:11 -0500 Subject: Fix bug reported by Ashwini Sharma: rebound has to be at the end or toy_init() doesn't zero the rest of the struct. --- toys.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/toys.h b/toys.h index 31193a4d..c59c3c51 100644 --- a/toys.h +++ b/toys.h @@ -119,13 +119,15 @@ extern struct toy_context { struct toy_list *which; // Which entry in toy_list is this one? char **argv; // Original command line arguments char **optargs; // Arguments left over from get_optflags() - jmp_buf *rebound; // longjmp here instead of exit when do_rebound set unsigned optflags; // Command line option flags from get_optflags() int exitval; // Value error_exit feeds to exit() int optc; // Count of optargs int exithelp; // Should error_exit print a usage message first? int old_umask; // Old umask preserved by TOYFLAG_UMASK int toycount; // Total number of commands in this build + + // This is at the end so toy_init() doesn't zero it. + jmp_buf *rebound; // longjmp here instead of exit when do_rebound set } toys; // Two big temporary buffers: one for use by commands, one for library functions -- cgit v1.2.3