comparison lib/xwrap.c @ 1678:4a6a53da1c53 draft

Remove xexec_optargs().
author Rob Landley <rob@landley.net>
date Sat, 07 Feb 2015 16:23:59 -0600
parents 10922d83392a
children ae981311e232
comparison
equal deleted inserted replaced
1677:49c851da3658 1678:4a6a53da1c53
126 126
127 void xflush(void) 127 void xflush(void)
128 { 128 {
129 if (fflush(stdout) || ferror(stdout)) perror_exit("write");; 129 if (fflush(stdout) || ferror(stdout)) perror_exit("write");;
130 } 130 }
131
132 // Call xexec with a chunk of optargs, starting at skip. (You can't just
133 // call xexec() directly because toy_init() frees optargs.)
134 void xexec_optargs(int skip)
135 {
136 char **s = toys.optargs;
137
138 toys.optargs = 0;
139 xexec(s+skip);
140 }
141
142 131
143 // Die unless we can exec argv[] (or run builtin command). Note that anything 132 // Die unless we can exec argv[] (or run builtin command). Note that anything
144 // with a path isn't a builtin, so /bin/sh won't match the builtin sh. 133 // with a path isn't a builtin, so /bin/sh won't match the builtin sh.
145 void xexec(char **argv) 134 void xexec(char **argv)
146 { 135 {