diff options
| author | grischka <grischka> | 2013-01-06 17:20:44 +0100 |
|---|---|---|
| committer | grischka <grischka> | 2013-01-06 17:20:44 +0100 |
| commit | 2358b378b3cd526956713f033f5a0ecaa5f63951 (patch) | |
| tree | 5b67d60c2992994e629276cbd0ff313d5219c716 /libtcc.c | |
| parent | e92dbe46869085d04544904b21c02991c226a828 (diff) | |
| download | tinycc-2358b378b3cd526956713f033f5a0ecaa5f63951.tar.gz tinycc-2358b378b3cd526956713f033f5a0ecaa5f63951.tar.bz2 | |
tccpp: alternative fix for #include_next infinite loop bug
This replaces commit 3d409b08893873b917ccb8c34398bc41a4e84d7c
- revert old fix in libtcc.c
- #include_next: look up the file in the include stack to see
if it is already included.
Also:
- streamline include code
- remove 'type' from struct CachedInclude (obsolete because we check
full filename anyway)
- remove inc_type & inc_filename from struct Bufferedfile (obsolete)
- fix bug with TOK_FLAG_ENDIF not being reset
- unrelated: get rid of an 'variable potentially uninitialized' warning
Diffstat (limited to 'libtcc.c')
| -rw-r--r-- | libtcc.c | 27 |
1 files changed, 0 insertions, 27 deletions
@@ -34,10 +34,6 @@ ST_DATA struct TCCState *tcc_state; /********************************************************/ -#ifndef _WIN32 -#include <limits.h> -#endif - #ifdef ONE_SOURCE #include "tccpp.c" #include "tccgen.c" @@ -322,30 +318,7 @@ static void tcc_split_path(TCCState *s, void ***p_ary, int *p_nb_ary, const char } } cstr_ccat(&str, '\0'); -#ifndef _WIN32 - { - int i, do_include; - char tmp[PATH_MAX]; - - if (realpath(str.data, tmp)) { - str.size = 0; - cstr_cat(&str, tmp); - cstr_ccat(&str, '\0'); - } - - do_include = 1; - for (i = 0; i < *p_nb_ary && do_include; i++) { - do_include = do_include && - strcmp((char*)str.data, (char*)(*p_ary)[i]); - } - - if (do_include) { - dynarray_add(p_ary, p_nb_ary, str.data); - } - } -#else dynarray_add(p_ary, p_nb_ary, str.data); -#endif in = p+1; } while (*p); } |
