MCPcopy Index your code
hub / github.com/RsyncProject/rsync / parse_one_refuse_match

Function parse_one_refuse_match

options.c:907–937  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

905
906
907static void parse_one_refuse_match(int negated, const char *ref, const struct poptOption *list_end)
908{
909 struct poptOption *op;
910 char shortName[2];
911 int is_wild = strpbrk(ref, "*?[") != NULL;
912 int found_match = 0;
913
914 shortName[1] = '\0';
915
916 if (strcmp("a", ref) == 0 || strcmp("archive", ref) == 0) {
917 ref = "[ardlptgoD]";
918 is_wild = 1;
919 }
920
921 for (op = long_options; op != list_end; op++) {
922 *shortName = op->shortName;
923 if ((op->longName && wildmatch(ref, op->longName))
924 || (*shortName && wildmatch(ref, shortName))) {
925 if (op->descrip[1] == '*')
926 op->descrip = negated ? "a*" : "r*";
927 else if (!is_wild)
928 op->descrip = negated ? "a=" : "r=";
929 found_match = 1;
930 if (!is_wild)
931 break;
932 }
933 }
934
935 if (!found_match)
936 rprintf(FLOG, "No match for refuse-options string \"%s\"\n", ref);
937}
938
939
940/**

Callers 1

set_refuse_optionsFunction · 0.85

Calls 3

strpbrkFunction · 0.85
wildmatchFunction · 0.85
rprintfFunction · 0.70

Tested by

no test coverage detected