| 905 | |
| 906 | |
| 907 | static 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 | /** |
no test coverage detected