- Timestamp:
- May 24, 2007 3:10:51 AM (18 years ago)
- Location:
- trunk/src/gmakenew
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gmakenew/file.c
r908 r910 474 474 for (d = old; d != 0; d = d->next) 475 475 { 476 size_t buffer_offset; /* bird */ 476 477 struct dep *new, *d1; 477 478 char *p; … … 485 486 if (! d->need_2nd_expansion) 486 487 { 487 size_t l; /* bird */488 488 p = variable_expand (""); 489 l = p - variable_buffer; /* bird */489 buffer_offset = p - variable_buffer; 490 490 variable_buffer_output (p, d->name, strlen (d->name) + 1); 491 p = variable_buffer + l; /* bird - this may have been reallocated!*/491 p = variable_buffer + buffer_offset; /* bird - variable_buffer may have been reallocated. (observed it) */ 492 492 } 493 493 else … … 499 499 char *o; 500 500 char *buffer = variable_expand (""); 501 buffer_offset = buffer - variable_buffer; /* bird */ 501 502 502 503 o = subst_expand (buffer, d->name, "%", "$*", 1, 2, 0); 504 buffer = variable_buffer + buffer_offset; /* bird - variable_buffer may have been reallocated. */ 503 505 504 506 d->name = strcache_add_len (buffer, o - buffer); … … 538 540 const char *pattern = "%"; 539 541 char *buffer = variable_expand (""); 542 const size_t buffer_offset = buffer - variable_buffer; /* bird */ 540 543 struct dep *dp = new, *dl = 0; 541 544 … … 562 565 o = patsubst_expand_pat (buffer, d->stem, pattern, nm, 563 566 pattern+1, percent+1); 567 buffer = variable_buffer + buffer_offset; /* bird - variable_buffer may have been reallocated. */ 568 564 569 565 570 /* If the name expanded to the empty string, ignore it. */ -
trunk/src/gmakenew/read.c
r903 r910 2186 2186 static const char *percent = "%"; 2187 2187 char *buffer = variable_expand (""); 2188 const size_t buffer_offset = buffer - variable_buffer; /* bird */ 2188 2189 char *o = patsubst_expand_pat (buffer, name, pattern, percent, 2189 2190 pattern_percent+1, percent+1); 2191 buffer = variable_buffer + buffer_offset; /* bird - variable_buffer may have been reallocated. */ 2190 2192 f->stem = strcache_add_len (buffer, o - buffer); 2191 2193 if (this) -
trunk/src/gmakenew/remake.c
r903 r910 809 809 #ifdef CONFIG_WITH_EXTENDED_NOTPARALLEL 810 810 /* update not_parallel if the file was flagged for that. */ 811 if ( ran 812 && (file->command_flags & (COMMANDS_NOTPARALLEL | COMMANDS_NO_COMMANDS)) 811 if ( ran 812 && (file->command_flags & (COMMANDS_NOTPARALLEL | COMMANDS_NO_COMMANDS)) 813 813 == COMMANDS_NOTPARALLEL) 814 814 { … … 1503 1503 static int libdir_maxlen = -1; 1504 1504 char *libbuf = variable_expand (""); 1505 const size_t libbuf_offset = libbuf - variable_buffer; /* bird */ 1505 1506 1506 1507 /* Expand the pattern using LIBNAME as a replacement. */ … … 1525 1526 p4 = variable_buffer_output (p4, p3+1, len - (p3-p)); 1526 1527 p[len] = c; 1528 libbuf = variable_buffer + libbuf_offset; /* bird - variable_buffer may have been reallocated. */ 1527 1529 } 1528 1530
Note:
See TracChangeset
for help on using the changeset viewer.