# HG changeset patch # User Michael Pavone # Date 1517985851 28800 # Node ID c416ace65ff1451633656c5d8536019cfb7c5bf8 # Parent 63659fb92db4b8e600adae52715172f574bc727b Fix const correctness for path_extension diff -r 63659fb92db4 -r c416ace65ff1 util.c --- a/util.c Tue Feb 06 22:42:16 2018 -0800 +++ b/util.c Tue Feb 06 22:44:11 2018 -0800 @@ -250,11 +250,11 @@ return barename; } -char *path_extension(char *path) +char *path_extension(char const *path) { - char *lastdot = NULL; - char *lastslash = NULL; - char *cur; + char const *lastdot = NULL; + char const *lastslash = NULL; + char const *cur; for (cur = path; *cur; cur++) { if (*cur == '.') { diff -r 63659fb92db4 -r c416ace65ff1 util.h --- a/util.h Tue Feb 06 22:42:16 2018 -0800 +++ b/util.h Tue Feb 06 22:44:11 2018 -0800 @@ -41,7 +41,7 @@ //Returns the basename of a path with th extension (if any) stripped char * basename_no_extension(char *path); //Returns the extension from a path or NULL if there is no extension -char *path_extension(char *path); +char *path_extension(char const *path); //Returns true if the given path matches one of the extensions in the list uint8_t path_matches_extensions(char *path, char **ext_list, uint32_t num_exts); //Returns the directory portion of a path or NULL if there is no directory part