changeset 386:df250e9d55a8

[project @ 2005-09-03 22:18:51 by bellard] normalized slashes in paths (Filip Navara)
author bellard
date Sat, 03 Sep 2005 22:18:51 +0000
parents 14ff3d95e91b
children eaf3c68531af
files tcc.c
diffstat 1 files changed, 5 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tcc.c	Sat Sep 03 22:03:39 2005 +0000
+++ b/tcc.c	Sat Sep 03 22:18:51 2005 +0000
@@ -1832,6 +1832,7 @@
 {
     int fd;
     BufferedFile *bf;
+    int i, len;
 
     fd = open(filename, O_RDONLY | O_BINARY);
     if (fd < 0)
@@ -1846,6 +1847,10 @@
     bf->buf_end = bf->buffer;
     bf->buffer[0] = CH_EOB; /* put eob symbol */
     pstrcpy(bf->filename, sizeof(bf->filename), filename);
+    len = strlen(bf->filename);
+    for (i = 0; i < len; i++)
+        if (bf->filename[i] == '\\')
+            bf->filename[i] = '/';
     bf->line_num = 1;
     bf->ifndef_macro = 0;
     bf->ifdef_stack_ptr = s1->ifdef_stack_ptr;