Changeset 3215 for trunk/src/kmk/kmkbuiltin/ln.c
- Timestamp:
- Mar 31, 2018, 12:01:55 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kmk/kmkbuiltin/ln.c
r3192 r3215 42 42 #endif /* no $id */ 43 43 44 #define FAKES_NO_GETOPT_H /* bird */ 44 45 #include "config.h" 45 46 #ifndef _MSC_VER … … 55 56 #include <string.h> 56 57 #include <unistd.h> 57 #include "getopt .h"58 #include "getopt_r.h" 58 59 #ifdef _MSC_VER 59 60 # include "mscfakes.h" … … 93 94 { 94 95 LNINSTANCE This; 96 struct getopt_state_r gos; 95 97 struct stat sb; 96 98 char *sourcedir; … … 107 109 This.linkf = NULL; 108 110 109 /* kmk: reset getopt() and set program name. */ 110 opterr = 1; 111 optarg = NULL; 112 optopt = 0; 113 optind = 0; /* init */ 114 115 while ((ch = getopt_long(argc, argv, "fhinsv", long_options, NULL)) != -1) 111 getopt_initialize_r(&gos, argc, argv, "fhinsv", long_options, envp, pCtx); 112 while ((ch = getopt_long_r(&gos, NULL)) != -1) 116 113 switch (ch) { 117 114 case 'f': … … 143 140 } 144 141 145 argv += optind;146 argc -= optind;142 argv += gos.optind; 143 argc -= gos.optind; 147 144 148 145 This.linkf = This.sflag ? symlink : link;
Note:
See TracChangeset
for help on using the changeset viewer.