History

fix #include_next infinite loop bug, see http://savannah.nongnu.org/bugs/?31357

Sergey Vinokurov committed 14 years ago

Commit 3d409b01 parent ca387921 file · +27 −0Browse files

Unified · Split

libtcc.c+27−0
@@ -34,6 +34,10 @@ ST_DATA struct TCCState *tcc_state; · 33 unmodified lines
34 34
35/********************************************************/35/********************************************************/
36 36
37#ifndef _WIN32
38#include <limits.h>
39#endif
40
37#ifdef ONE_SOURCE41#ifdef ONE_SOURCE
38#include "tccpp.c"42#include "tccpp.c"
39#include "tccgen.c"43#include "tccgen.c"
@@ -318,7 +322,30 @@ static void tcc_split_path(TCCState *s, void ***p_ary, int *p_nb_ary, const char · 278 unmodified lines
318 }322 }
319 }323 }
320 cstr_ccat(&str, '\0');324 cstr_ccat(&str, '\0');
325#ifndef _WIN32
326 {
327 int i, do_include;
328 char tmp[PATH_MAX];
329
330 if (realpath(str.data, tmp)) {
331 str.size = 0;
332 cstr_cat(&str, tmp);
333 cstr_ccat(&str, '\0');
334 }
335
336 do_include = 1;
337 for (i = 0; i < *p_nb_ary && do_include; i++) {
338 do_include = do_include &&
339 strcmp((char*)str.data, (char*)(*p_ary)[i]);
340 }
341
342 if (do_include) {
343 dynarray_add(p_ary, p_nb_ary, str.data);
344 }
345 }
346#else
321 dynarray_add(p_ary, p_nb_ary, str.data);347 dynarray_add(p_ary, p_nb_ary, str.data);
348#endif
322 in = p+1;349 in = p+1;
323 } while (*p);350 } while (*p);
324}351}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t