diff options
author | Kurt Zenker <kz@openoffice.org> | 2008-03-05 17:29:19 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2008-03-05 17:29:19 +0000 |
commit | 84e70069a6e9b0e7abefeb05b0b276c3d16e210c (patch) | |
tree | 5be42aa97296f83d463423cbb773411240e4a2d9 /dmake | |
parent | 985fe04452cecaed08971e910c17cc7565f36498 (diff) |
INTEGRATION: CWS dmake412_DEV300 (1.11.2); FILE MERGED
2008/02/04 21:05:42 vq 1.11.2.2: #i85381# Fix possible heap corruption for the cygwin dmake version.
2008/01/06 21:21:09 vq 1.11.2.1: #i85014# Let master targets for targets with multiple (::) rules inherit
the newest time stamp of their "sub"-rules.
Make runargv() indicate that it finished the command when it had to wait
for its completion.
Diffstat (limited to 'dmake')
-rw-r--r-- | dmake/make.c | 45 |
1 files changed, 27 insertions, 18 deletions
diff --git a/dmake/make.c b/dmake/make.c index bb1b5c5d1..0dfad3b34 100644 --- a/dmake/make.c +++ b/dmake/make.c @@ -1,6 +1,6 @@ /* $RCSfile: make.c,v $ --- $Revision: 1.11 $ --- last change: $Author: ihi $ $Date: 2007-10-15 15:40:19 $ +-- $Revision: 1.12 $ +-- last change: $Author: kz $ $Date: 2008-03-05 18:29:19 $ -- -- SYNOPSIS -- Perform the update of all outdated targets. @@ -166,7 +166,7 @@ gen_path_list_string(LISTSTRINGPTR s)/* len=cell->len; #else /* For cygwin with .WINPATH set the lenght of the converted - * filepaths might me longer. Extra checking is needed ... */ + * filepaths might be longer. Extra checking is needed ... */ tpath = DO_WINPATH(cell->datum); if( tpath == cell->datum ) { len=cell->len; @@ -174,26 +174,29 @@ gen_path_list_string(LISTSTRINGPTR s)/* else { /* ... but only if DO_WINPATH() did something. */ len = strlen(tpath); - - if( len > slen_rest ) { - /* We need more memory. As DOS paths are usually shorter than the - * original cygwin POSIX paths (exception mounted paths) this should - * rarely happen. */ - int p_offset = p - result; - /* Get more than needed. */ - slen += slen + len-slen_rest + 128; - if((result = realloc( result, (unsigned)(slen*sizeof(char)) ) ) == NULL) - No_ram(); - p = result + p_offset; - } } - - slen_rest -= len; + if( len >= slen_rest ) { + /* We need more memory. As DOS paths are usually shorter than the + * original cygwin POSIX paths (exception mounted paths) this should + * rarely happen. */ + int p_offset = p - result; + /* Get more than needed. */ + slen = slen + len - slen_rest + 128; + if((result = realloc( result, slen ) ) == NULL) + No_ram(); + p = result + p_offset; + } #endif memcpy((void *)p, (void *)tpath, len); p += len; *p++ = ' '; + +#if defined(__CYGWIN__) + /* slen_rest is only used in the cygwin / .WINPATH case. */ + slen_rest = slen - (p - result); +#endif + next = cell->next; free_cell(cell); } @@ -583,7 +586,8 @@ CELLPTR setdirroot; if( cp->ce_attr & A_LIBRARY ) tcp->ce_attr ^= A_LIBRARYM; - /* Return on error or if Make() is still running and A_SEQ is set. */ + /* Return on error or if Make() is still running and A_SEQ is set. + * (All F_MULTI targets have the A_SEQ attribute.) */ if( rval == -1 || (seq && (rval==1)) ) goto stop_making_it; @@ -632,6 +636,11 @@ CELLPTR setdirroot; } } + /* If we are building a F_MULTI target inherit the time from + * its children. */ + if( (cp->ce_flag & F_MULTI) ) + cp->ce_time = otime; + /* All prerequisites are made, now make the current target. */ /* Restore UseWinpath and $@ if needed, see above for an explanation. */ |