X-Git-Url: https://git.brokenzipper.com/gitweb?a=blobdiff_plain;f=src%2Fnames.c;h=2b24231efe4571abc341a41405ae7a213afed910;hb=b794387cbaef6374a28e6ffe709e319e0a0647f0;hp=e6082d856af00b1532edca3c2fe133652b5dc9d7;hpb=13aead50a8cb8b20532a4eb26dd84cde52970806;p=chaz%2Ftar diff --git a/src/names.c b/src/names.c index e6082d8..2b24231 100644 --- a/src/names.c +++ b/src/names.c @@ -209,6 +209,7 @@ name_add (const char *name) } name_array[names++] = name; } + /* Names from external name file. */ @@ -428,7 +429,8 @@ addname (char const *string, int change_dir) name->firstch = 1; /* assume first char is literal */ name->change_dir = change_dir; name->dir_contents = 0; - + name->explicit = 1; + if (string && is_pattern (string)) { name->regexp = 1; @@ -708,6 +710,8 @@ add_hierarchy_to_namelist (struct name *name, dev_t device) string_length = strlen (string); if (*string == 'D') { + struct name *np; + if (allocated_length <= name_length + string_length) { do @@ -721,8 +725,9 @@ add_hierarchy_to_namelist (struct name *name, dev_t device) namebuf = xrealloc (namebuf, allocated_length + 1); } strcpy (namebuf + name_length, string + 1); - add_hierarchy_to_namelist (addname (namebuf, change_dir), - device); + np = addname (namebuf, change_dir); + np->explicit = 0; + add_hierarchy_to_namelist (np, device); } }