diff options
author | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-03-06 08:11:43 -0500 |
---|---|---|
committer | Joseph Hunkeler <jhunkeler@gmail.com> | 2024-03-06 08:11:43 -0500 |
commit | 13e6c960377c3e53e2bb71b4a87f4ca86c01d343 (patch) | |
tree | 112bccc99b6fd70508b06d93c08427fccaa27c0a | |
parent | c4ec90bd48ddd6134b1eeef5a4d65d1a93ce803f (diff) | |
download | stasis-13e6c960377c3e53e2bb71b4a87f4ca86c01d343.tar.gz |
Fix path_basename
* Return original pointer when path separator is not present
-rw-r--r-- | src/utils.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/utils.c b/src/utils.c index b669e1c..39e29d0 100644 --- a/src/utils.c +++ b/src/utils.c @@ -132,7 +132,7 @@ char *path_basename(char *path) { char *last = NULL; if ((last = strrchr(path, '/')) == NULL) { - return result; + return path; } // Perform a lookahead ensuring the string is valid beyond the last separator if (last++ != NULL) { |