Changeset 3216 for trunk/src/kmk/kmkbuiltin/rmdir.c
- Timestamp:
- Mar 31, 2018, 12:09:15 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk/kmkbuiltin/rmdir.c
r3192 r3216 48 48 * Header Files * 49 49 *********************************************************************************************************************************/ 50 #define FAKES_NO_GETOPT_H /* bird */ 50 51 #include "config.h" 51 52 #include "err.h" … … 58 59 # include <alloca.h> 59 60 #endif 60 #include "getopt .h"61 #include "getopt_r.h" 61 62 #include "kmkbuiltin.h" 62 63 … … 110 111 { 111 112 RMDIRINSTANCE This; 113 struct getopt_state_r gos; 112 114 int ch, errors; 113 115 … … 119 121 This.pflag = 0; 120 122 121 /* kmk: reset getopt and set progname */ 122 opterr = 1; 123 optarg = NULL; 124 optopt = 0; 125 optind = 0; /* init */ 126 while ((ch = getopt_long(argc, argv, "pv", long_options, NULL)) != -1) 123 getopt_initialize_r(&gos, argc, argv, "pv", long_options, envp, pCtx); 124 while ((ch = getopt_long_r(&gos, NULL)) != -1) 127 125 switch(ch) { 128 126 case 'p': … … 147 145 return usage(pCtx, 1); 148 146 } 149 argc -= optind;150 argv += optind;147 argc -= gos.optind; 148 argv += gos.optind; 151 149 152 150 if (argc == 0)
Note:
See TracChangeset
for help on using the changeset viewer.