cproc

Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.nihaljere.xyz/cproc
Log | Files | Refs | Submodules | README | LICENSE

commit ab995bcc5c65393c7d59cebb794125db7f2a6fda
parent 9c80c96e84c398165df1cd304c32229acb8328dc
Author: Michael Forney <mforney@mforney.org>
Date:   Thu, 21 Feb 2019 23:02:08 -0800

driver: Create output files in current directory

Diffstat:
Mdriver.c | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git 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);