mirror of
https://git.savannah.gnu.org/git/coreutils.git
synced 2026-11-19 03:33:43 +03:00
(base_name): Add an assertion.
This commit is contained in:
1 parent
dbca6b183b
commit
2546495dab
1 file changed
+5
@@ -19,6 +19,8 @@
|
||||
# include <config.h>
|
||||
#endif
|
||||
|
||||
#include <assert.h>
|
||||
|
||||
#ifndef FILESYSTEM_PREFIX_LEN
|
||||
# define FILESYSTEM_PREFIX_LEN(Filename) 0
|
||||
#endif
|
||||
@@ -61,5 +63,8 @@ base_name (char const *name)
|
||||
if (*base == '\0' && ISSLASH (*name) && all_slashes)
|
||||
--base;
|
||||
|
||||
/* Make sure the last byte is not a slash. */
|
||||
assert (all_slashes || *(p - 1) != '/');
|
||||
|
||||
return (char *) base;
|
||||
}
|
||||
Reference in new issue
Block a user