| 200 | } |
| 201 | |
| 202 | void poptResetContext(poptContext con) |
| 203 | { |
| 204 | int i; |
| 205 | |
| 206 | if (con == NULL) return; |
| 207 | while (con->os > con->optionStack) { |
| 208 | cleanOSE(con->os--); |
| 209 | } |
| 210 | con->os->argb = PBM_FREE(con->os->argb); |
| 211 | con->os->currAlias = NULL; |
| 212 | con->os->nextCharArg = NULL; |
| 213 | con->os->nextArg = _free(con->os->nextArg); |
| 214 | if (!(con->flags & POPT_CONTEXT_KEEP_FIRST)) |
| 215 | con->os->next = 1; /* skip argv[0] */ |
| 216 | else |
| 217 | con->os->next = 0; |
| 218 | |
| 219 | for (i = 0; i < con->numLeftovers; i++) { |
| 220 | con->leftovers[i] = _free(con->leftovers[i]); |
| 221 | } |
| 222 | con->numLeftovers = 0; |
| 223 | con->nextLeftover = 0; |
| 224 | con->restLeftover = 0; |
| 225 | con->doExec = NULL; |
| 226 | con->execFail = _free(con->execFail); |
| 227 | |
| 228 | if (con->finalArgv != NULL) |
| 229 | for (i = 0; i < con->finalArgvCount; i++) { |
| 230 | con->finalArgv[i] = _free(con->finalArgv[i]); |
| 231 | } |
| 232 | |
| 233 | con->finalArgvCount = 0; |
| 234 | con->arg_strip = PBM_FREE(con->arg_strip); |
| 235 | return; |
| 236 | } |
| 237 | |
| 238 | /* Only one of longName, shortName should be set, not both. */ |
| 239 | static int handleExec(poptContext con, |
no test coverage detected