comparison toys.h @ 1274:c47218ccbfdf draft

Fix bug reported by Ashwini Sharma: rebound has to be at the end or toy_init() doesn't zero the rest of the struct.
author Rob Landley <rob@landley.net>
date Mon, 05 May 2014 21:20:11 -0500
parents b13728c24a58
children 313980d3d78c
comparison
equal deleted inserted replaced
1273:79e847fec774 1274:c47218ccbfdf
117 117
118 extern struct toy_context { 118 extern struct toy_context {
119 struct toy_list *which; // Which entry in toy_list is this one? 119 struct toy_list *which; // Which entry in toy_list is this one?
120 char **argv; // Original command line arguments 120 char **argv; // Original command line arguments
121 char **optargs; // Arguments left over from get_optflags() 121 char **optargs; // Arguments left over from get_optflags()
122 jmp_buf *rebound; // longjmp here instead of exit when do_rebound set
123 unsigned optflags; // Command line option flags from get_optflags() 122 unsigned optflags; // Command line option flags from get_optflags()
124 int exitval; // Value error_exit feeds to exit() 123 int exitval; // Value error_exit feeds to exit()
125 int optc; // Count of optargs 124 int optc; // Count of optargs
126 int exithelp; // Should error_exit print a usage message first? 125 int exithelp; // Should error_exit print a usage message first?
127 int old_umask; // Old umask preserved by TOYFLAG_UMASK 126 int old_umask; // Old umask preserved by TOYFLAG_UMASK
128 int toycount; // Total number of commands in this build 127 int toycount; // Total number of commands in this build
128
129 // This is at the end so toy_init() doesn't zero it.
130 jmp_buf *rebound; // longjmp here instead of exit when do_rebound set
129 } toys; 131 } toys;
130 132
131 // Two big temporary buffers: one for use by commands, one for library functions 133 // Two big temporary buffers: one for use by commands, one for library functions
132 134
133 extern char toybuf[4096], libbuf[4096]; 135 extern char toybuf[4096], libbuf[4096];