C includes: where is last_component defined?

99 views Asked by At

See below logic from wget source code. Where is last_component defined? I presume this is either a GNU include or buried somewhere in the standard C includes. But I can't seem to locate it. Thx.

char *
get_metalink_basename (char *name)
{
  int n;
  char *basename;

  if (!name)
    return NULL;

  basename = last_component (name);

  while ((n = FILE_SYSTEM_PREFIX_LEN (basename)) > 0)
    basename += n;

  return metalink_check_safe_path (basename) ? basename : NULL;
}
1

There are 1 answers

0
KamilCuk On BEST ANSWER

Wget uses gnulib. last_component is declared in basename-lgpl.h and defined in basename-lgpl.c.