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

Function poptSaveBits

popt/popt.c:863–895  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

861}
862
863int poptSaveBits(poptBits * bitsp,
864 UNUSED(unsigned int argInfo), const char * s)
865{
866 char *tbuf = NULL;
867 char *t, *te;
868 int rc = 0;
869
870 if (bitsp == NULL || s == NULL || *s == '\0' || _poptBitsNew(bitsp))
871 return POPT_ERROR_NULLARG;
872
873 /* Parse comma separated attributes. */
874 te = tbuf = xstrdup(s);
875 while ((t = te) != NULL && *t) {
876 while (*te != '\0' && *te != ',')
877 te++;
878 if (*te != '\0')
879 *te++ = '\0';
880 /* XXX Ignore empty strings. */
881 if (*t == '\0')
882 continue;
883 /* XXX Permit negated attributes. caveat emptor: false negatives. */
884 if (*t == '!') {
885 t++;
886 if ((rc = poptBitsChk(*bitsp, t)) > 0)
887 rc = poptBitsDel(*bitsp, t);
888 } else
889 rc = poptBitsAdd(*bitsp, t);
890 if (rc)
891 break;
892 }
893 tbuf = _free(tbuf);
894 return rc;
895}
896
897int poptSaveString(const char *** argvp,
898 UNUSED(unsigned int argInfo), const char * val)

Callers 1

poptSaveArgFunction · 0.85

Calls 5

_poptBitsNewFunction · 0.85
poptBitsChkFunction · 0.85
poptBitsDelFunction · 0.85
poptBitsAddFunction · 0.85
_freeFunction · 0.85

Tested by

no test coverage detected