src/SDCCmain.c (processFile): fix processing of ../../src.c
authorbernhardheld <bernhardheld@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Tue, 8 Jan 2002 22:18:29 +0000 (22:18 +0000)
committerbernhardheld <bernhardheld@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Tue, 8 Jan 2002 22:18:29 +0000 (22:18 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1781 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
src/SDCCmain.c

index 903ed250f3baaad2651e3a2885cd6f1714f0e19c..9f4db4ae0532f13947c43b4f0935cb4609a6fe8a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2001-01-04  Bernhard Held  <bernhard@bernhardheld.de>
+
+       * src/SDCCmain.c (processFile): fix processing of ../../src.c
+
 2001-01-04  Bernhard Held  <bernhard@bernhardheld.de>
 
        * src/SDCCglue.h: printIvalCharPtr(), not printIvalChar()
index 91f9698161ac77d7651e39b4e651648a6b144978..c65ebd24ef5483038e8852bf1bd5ff7fa9c105e3 100644 (file)
@@ -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);