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

Function glob_expand_module

util1.c:804–837  ·  view source on GitHub ↗

This routine is only used in daemon mode. */

Source from the content-addressed store, hash-verified

802
803/* This routine is only used in daemon mode. */
804void glob_expand_module(char *base1, char *arg, char ***argv_p, int *argc_p, int *maxargs_p)
805{
806 char *p, *s;
807 char *base = base1;
808 int base_len = strlen(base);
809
810 if (!arg || !*arg)
811 return;
812
813 if (strncmp(arg, base, base_len) == 0)
814 arg += base_len;
815
816 if (protect_args) {
817 glob_expand(arg, argv_p, argc_p, maxargs_p);
818 return;
819 }
820
821 arg = strdup(arg);
822
823 if (asprintf(&base," %s/", base1) < 0)
824 out_of_memory("glob_expand_module");
825 base_len++;
826
827 for (s = arg; *s; s = p + base_len) {
828 if ((p = strstr(s, base)) != NULL)
829 *p = '\0'; /* split it at this point */
830 glob_expand(s, argv_p, argc_p, maxargs_p);
831 if (!p)
832 break;
833 }
834
835 free(arg);
836 free(base);
837}
838
839/**
840 * Convert a string to lower case

Callers 1

read_argsFunction · 0.85

Calls 2

glob_expandFunction · 0.85
asprintfFunction · 0.85

Tested by

no test coverage detected