MCPcopy Create free account
hub / github.com/RsyncProject/rsync / findNextArg

Function findNextArg

popt/popt.c:615–645  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

613}
614
615static const char * findNextArg(poptContext con,
616 unsigned argx, int delete_arg)
617{
618 struct optionStackEntry * os = con->os;
619 const char * arg;
620
621 do {
622 int i;
623 arg = NULL;
624 while (os->next == os->argc && os > con->optionStack) os--;
625 if (os->next == os->argc && os == con->optionStack) break;
626 if (os->argv != NULL)
627 for (i = os->next; i < os->argc; i++) {
628 if (os->argb && PBM_ISSET(i, os->argb))
629 continue;
630 if (*os->argv[i] == '-')
631 continue;
632 if (--argx > 0)
633 continue;
634 arg = os->argv[i];
635 if (delete_arg) {
636 if (os->argb == NULL) os->argb = PBM_ALLOC(os->argc);
637 if (os->argb != NULL) /* XXX can't happen */
638 PBM_SET(i, os->argb);
639 }
640 break;
641 }
642 if (os > con->optionStack) os--;
643 } while (arg == NULL);
644 return arg;
645}
646
647static const char *
648expandNextArg(poptContext con, const char * s)

Callers 1

expandNextArgFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected