From 7e33e04399e2bff99374b82e35e6e551e8f43e5a Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Thu, 16 Nov 2017 17:14:36 +0000 Subject: [PATCH] cc: temporaries in current directory --- Applications/SmallC/frontend.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Applications/SmallC/frontend.c b/Applications/SmallC/frontend.c index 61224b2d..bee3b651 100644 --- a/Applications/SmallC/frontend.c +++ b/Applications/SmallC/frontend.c @@ -169,7 +169,12 @@ static char *pathmod(char *p, char *f, char *t, int rmif) if (*rmptr++ == NULL) memory(); } - return p; + /* Traditionally compilers dump the work files in the current dir + even if the source is /foo/bar/baz.c - follow this */ + x = strrchr(p,'/'); + if (x == NULL) + return p; + return x+1; } static void add_argument(char *p) -- 2.34.1