winsup/utils/dump_setup.cc: Remove the function 'base'
This was called only on filenames in /etc/setup/installed.db, which are all basenames anyway. Moreover, base wasn't correctly handling filenames containing colons.
This commit is contained in:
parent
f6ef29c48f
commit
3e8323dc06
@ -48,21 +48,6 @@ find_tar_ext (const char *path)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static char *
|
||||
base (const char *s)
|
||||
{
|
||||
if (!s)
|
||||
return 0;
|
||||
const char *rv = s;
|
||||
while (*s)
|
||||
{
|
||||
if ((*s == '/' || *s == ':' || *s == '\\') && s[1])
|
||||
rv = s + 1;
|
||||
s++;
|
||||
}
|
||||
return (char *) rv;
|
||||
}
|
||||
|
||||
/* Parse a filename into package, version, and extension components. */
|
||||
int
|
||||
parse_filename (const char *in_fn, fileparse& f)
|
||||
@ -79,7 +64,7 @@ parse_filename (const char *in_fn, fileparse& f)
|
||||
strcpy (f.tail, fn + n);
|
||||
fn[n] = '\0';
|
||||
f.pkg[0] = f.what[0] = '\0';
|
||||
p = base (fn);
|
||||
p = fn;
|
||||
for (ver = p; *ver; ver++)
|
||||
if (*ver != '-')
|
||||
continue;
|
||||
|
Loading…
Reference in New Issue
Block a user