removing directory path components when creating basename
authorJohn Tsiombikas <nuclear@member.fsf.org>
Sun, 17 Feb 2019 14:37:40 +0000 (16:37 +0200)
committerJohn Tsiombikas <nuclear@member.fsf.org>
Sun, 17 Feb 2019 14:37:40 +0000 (16:37 +0200)
src/main.c

index 0474894..2f011c9 100644 (file)
@@ -102,6 +102,9 @@ int proc_image(const char *fname)
        }
        basename = alloca(strlen(fname) + 1);
        strcpy(basename, fname);
+       if((suffix = strrchr(basename, '/'))) {
+               basename = suffix;
+       }
        if((suffix = strchr(basename, '.'))) {
                *suffix = 0;
        }