From ab995bcc5c65393c7d59cebb794125db7f2a6fda Mon Sep 17 00:00:00 2001 From: Michael Forney Date: Thu, 21 Feb 2019 23:02:08 -0800 Subject: driver: Create output files in current directory --- driver.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/driver.c b/driver.c index f30f413..cca2c65 100644 --- a/driver.c +++ b/driver.c @@ -100,9 +100,9 @@ changeext(const char *name, const char *ext) size_t baselen; slash = strrchr(name, '/'); - if (!slash) - slash = name; - dot = strrchr(slash, '.'); + if (slash) + name = slash + 1; + dot = strrchr(name, '.'); baselen = dot ? (size_t)(--dot - name + 1) : strlen(name); result = xmalloc(baselen + strlen(ext) + 2); memcpy(result, name, baselen); -- cgit v1.2.3