diff options
| author | bellard <bellard> | 2005-09-03 22:18:51 +0000 |
|---|---|---|
| committer | bellard <bellard> | 2005-09-03 22:18:51 +0000 |
| commit | 81f957ae09642e4b8425c830a3444b464fb4aae4 (patch) | |
| tree | 23a5c410e93c29af63ae972c1a15d79334eb6e0f | |
| parent | 3ba1190eb4b7ec2f1ec6be6aa1e983f051313796 (diff) | |
| download | tinycc-81f957ae09642e4b8425c830a3444b464fb4aae4.tar.gz tinycc-81f957ae09642e4b8425c830a3444b464fb4aae4.tar.bz2 | |
normalized slashes in paths (Filip Navara)
| -rw-r--r-- | tcc.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -1832,6 +1832,7 @@ BufferedFile *tcc_open(TCCState *s1, const char *filename) { int fd; BufferedFile *bf; + int i, len; fd = open(filename, O_RDONLY | O_BINARY); if (fd < 0) @@ -1846,6 +1847,10 @@ BufferedFile *tcc_open(TCCState *s1, const char *filename) 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; |
