mirror of
https://github.com/troglobit/finit.git
synced 2026-10-26 12:14:37 +00:00
Refactor, ensure basenm() returns a const char pointer of its arg.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
f29e92be21
commit
791df0c986
4 files changed
+16
-12
No files matched your search
+3
-3
@@ -152,13 +152,13 @@ char *progname(char *arg0)
|
||||
}
|
||||
|
||||
/* basename(3) replacement that does not modify its argument */
|
||||
char *basenm(const char *path)
|
||||
const char *basenm(const char *path)
|
||||
{
|
||||
char *basename;
|
||||
const char *basename;
|
||||
|
||||
basename = rindex(path, '/');
|
||||
if (!basename)
|
||||
return (char *) path;
|
||||
return path;
|
||||
|
||||
basename++;
|
||||
return basename;
|
||||
|
||||
Reference in new issue
Block a user