diff options
author | Hiltjo Posthuma <hiltjo@codemadness.org> | 2016-04-10 14:36:16 +0200 |
---|---|---|
committer | Hiltjo Posthuma <hiltjo@codemadness.org> | 2016-04-10 14:36:16 +0200 |
commit | 8a3177f96dd4c3694242d0686762c455a9d010fd (patch) | |
tree | dc33f65dbb40abd8b9fae22833d52998b985bfad /sfeed_plain.c | |
parent | fe6bc99b1ed59c428ffe5da44eafcf3712d3d80d (diff) |
remove basename, just use last part of the path...
... as a bonus it also saves an allocation.
Diffstat (limited to 'sfeed_plain.c')
-rw-r--r-- | sfeed_plain.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/sfeed_plain.c b/sfeed_plain.c index 78cfae0..ee836b5 100644 --- a/sfeed_plain.c +++ b/sfeed_plain.c @@ -67,9 +67,8 @@ main(int argc, char *argv[]) for (i = 1; i < argc; i++) { if (!(fp = fopen(argv[i], "r"))) err(1, "fopen: %s", argv[i]); - name = xbasename(argv[i]); + name = ((name = strrchr(argv[i], '/'))) ? name + 1 : argv[i]; printfeed(fp, name); - free(name); if (ferror(fp)) err(1, "ferror: %s", argv[i]); fclose(fp); |