From 0c9fb00341a64f6c26cee71602484f559029e7fe Mon Sep 17 00:00:00 2001 From: bernhardheld Date: Tue, 8 Jan 2002 22:18:29 +0000 Subject: [PATCH] src/SDCCmain.c (processFile): fix processing of ../../src.c git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1781 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- ChangeLog | 4 ++++ src/SDCCmain.c | 11 +++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 903ed250..9f4db4ae 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2001-01-04 Bernhard Held + + * src/SDCCmain.c (processFile): fix processing of ../../src.c + 2001-01-04 Bernhard Held * src/SDCCglue.h: printIvalCharPtr(), not printIvalChar() diff --git a/src/SDCCmain.c b/src/SDCCmain.c index 91f96981..c65ebd24 100644 --- a/src/SDCCmain.c +++ b/src/SDCCmain.c @@ -520,8 +520,15 @@ processFile (char *s) /* copy the file name into the buffer */ strcpy (buffer, s); - /* get rid of the "." */ - strtok (buffer, "."); + /* get rid of the "."-extension */ + + /* is there a dot at all? */ + if (strchr (buffer, '.') && + /* is the dot in the filename, not in the path? */ + (strrchr (buffer, '/' ) < strrchr (buffer, '.') || + strrchr (buffer, '\\') < strrchr (buffer, '.'))) + *strrchr (buffer, '.') = '\0'; + srcFileName = Safe_alloc ( strlen (buffer) + 1); strcpy (srcFileName, buffer); -- 2.30.2