mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-29 19:30:36 +02:00
basename: drop last_component null check
Prepare for fixes to the suffix pruning. Since last_component doesn't document a possible null result in lib/basename-lgpl.h, and the current code also doesn't appear capable of producing one, drop the check. libguile/filesys.c (basename): drop check for last_component null result.
This commit is contained in:
parent
2047b532fa
commit
9a57c237d2
1 changed files with 3 additions and 8 deletions
|
@ -2043,7 +2043,7 @@ SCM_DEFINE (scm_basename, "basename", 1, 1, 0,
|
|||
"@var{filename}, it is removed also.")
|
||||
#define FUNC_NAME s_scm_basename
|
||||
{
|
||||
char *c_filename, *c_last_component;
|
||||
char *c_filename;
|
||||
SCM res;
|
||||
|
||||
scm_dynwind_begin (0);
|
||||
|
@ -2057,13 +2057,8 @@ SCM_DEFINE (scm_basename, "basename", 1, 1, 0,
|
|||
"/" and "//" are treated specially. */
|
||||
res = scm_from_utf8_string ("/");
|
||||
else
|
||||
{
|
||||
c_last_component = last_component (c_filename);
|
||||
if (!c_last_component)
|
||||
res = filename;
|
||||
else
|
||||
res = scm_from_utf8_string (c_last_component);
|
||||
}
|
||||
res = scm_from_utf8_string (last_component (c_filename));
|
||||
|
||||
scm_dynwind_end ();
|
||||
|
||||
if (!SCM_UNBNDP (suffix) &&
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue