diff options
author | Jan Holesovsky <kendy@suse.cz> | 2010-08-18 17:49:08 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@suse.cz> | 2010-08-18 17:49:08 +0200 |
commit | 17523819d614d1a84c63426b6834dfe11ec530ef (patch) | |
tree | 36bdbdb7b5abbb10fdb2a7145b116e49247660aa /dmake | |
parent | f645e1bc33365b4edcbff1f2cfad49efce19246d (diff) | |
parent | ce36f29b1f93dc4cd000289b7e23c47be65147b2 (diff) |
Merge commit 'ooo/OOO330_m4'
Diffstat (limited to 'dmake')
-rwxr-xr-x | dmake/Makefile.am | 42 | ||||
-rwxr-xr-x | dmake/Makefile.in | 42 | ||||
-rw-r--r-- | dmake/dag.c | 9 | ||||
-rw-r--r-- | dmake/expand.c | 26 | ||||
-rw-r--r-- | dmake/getinp.c | 6 | ||||
-rw-r--r-- | dmake/make.c | 20 | ||||
-rw-r--r-- | dmake/path.c | 10 | ||||
-rw-r--r-- | dmake/rulparse.c | 5 | ||||
-rwxr-xr-x | dmake/tests/misc-13 | 2 | ||||
-rwxr-xr-x | dmake/tests/misc-15 | 2 | ||||
-rwxr-xr-x | dmake/tests/targets-28 | 4 | ||||
-rw-r--r-- | dmake/unix/runargv.c | 15 |
12 files changed, 102 insertions, 81 deletions
diff --git a/dmake/Makefile.am b/dmake/Makefile.am index 672f688c9ff0..801ee2967c47 100755 --- a/dmake/Makefile.am +++ b/dmake/Makefile.am @@ -1,35 +1,27 @@ #************************************************************************* # -# OpenOffice.org - a multi-platform office productivity suite +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. # -# $RCSfile: Makefile.am,v $ +# OpenOffice.org - a multi-platform office productivity suite # -# $Revision: 1.12 $ +# This file is part of OpenOffice.org. # -# last change: $Author: kz $ $Date: 2008-03-05 18:26:19 $ +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. # -# The Contents of this file are made available subject to -# the terms of GNU Lesser General Public License Version 2.1. +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). # -# -# GNU Lesser General Public License Version 2.1 -# ============================================= -# Copyright 2005 by Sun Microsystems, Inc. -# 901 San Antonio Road, Palo Alto, CA 94303, USA -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License version 2.1, as published by the Free Software Foundation. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, -# MA 02111-1307 USA +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# <http://www.openoffice.org/license.html> +# for a copy of the LGPLv3 License. # #************************************************************************* diff --git a/dmake/Makefile.in b/dmake/Makefile.in index ed78925f6bfc..c25cc18ef247 100755 --- a/dmake/Makefile.in +++ b/dmake/Makefile.in @@ -16,36 +16,28 @@ #************************************************************************* # -# OpenOffice.org - a multi-platform office productivity suite +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# Copyright 2000, 2010 Oracle and/or its affiliates. # -# $RCSfile: Makefile.in,v $ +# OpenOffice.org - a multi-platform office productivity suite # -# $Revision: 1.15 $ +# This file is part of OpenOffice.org. # -# last change: $Author: kz $ $Date: 2008-03-05 18:26:33 $ +# OpenOffice.org is free software: you can redistribute it and/or modify +# it under the terms of the GNU Lesser General Public License version 3 +# only, as published by the Free Software Foundation. # -# The Contents of this file are made available subject to -# the terms of GNU Lesser General Public License Version 2.1. +# OpenOffice.org is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Lesser General Public License version 3 for more details +# (a copy is included in the LICENSE file that accompanied this code). # -# -# GNU Lesser General Public License Version 2.1 -# ============================================= -# Copyright 2005 by Sun Microsystems, Inc. -# 901 San Antonio Road, Palo Alto, CA 94303, USA -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License version 2.1, as published by the Free Software Foundation. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -# Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this library; if not, write to the Free Software -# Foundation, Inc., 59 Temple Place, Suite 330, Boston, -# MA 02111-1307 USA +# You should have received a copy of the GNU Lesser General Public License +# version 3 along with OpenOffice.org. If not, see +# <http://www.openoffice.org/license.html> +# for a copy of the LGPLv3 License. # #************************************************************************* diff --git a/dmake/dag.c b/dmake/dag.c index ab5f7d9400c7..c10c12c18f1e 100644 --- a/dmake/dag.c +++ b/dmake/dag.c @@ -369,14 +369,17 @@ int flags; /* initial ht_flags */ /* strip out any \<nl> combinations where \ is the current * CONTINUATION char */ for(p=q; (p=strchr(p,CONTINUATION_CHAR))!=NIL(char); ) - if( p[1] == '\n' ) - strcpy( p, p+2 ); + if( p[1] == '\n' ) { + size_t len = strlen(p+2)+1; + memmove ( p, p+2, len ); + } else p++; p = DmStrSpn(q ," \t"); /* Strip white space before ... */ if( p != q ) { - strcpy( q, p); + size_t len = strlen(p)+1; + memmove( q, p, len ); p = q; } diff --git a/dmake/expand.c b/dmake/expand.c index f3db8ed02fd3..b7232303177e 100644 --- a/dmake/expand.c +++ b/dmake/expand.c @@ -230,6 +230,7 @@ Map_esc( tok )/* char *tok; { if( strchr( "\"\\vantbrf01234567", tok[1] ) ) { + size_t len; switch( tok[1] ) { case 'a' : *tok = 0x07; break; case 'b' : *tok = '\b'; break; @@ -246,13 +247,15 @@ char *tok; register int j = 0; for( ; i<2 && isdigit(tok[2]); i++ ) { j = (j << 3) + (tok[1] - '0'); - strcpy( tok+1, tok+2 ); + len = strlen(tok+2)+1; + memmove( tok+1, tok+2, len ); } j = (j << 3) + (tok[1] - '0'); *tok = j; } } - strcpy( tok+1, tok+2 ); + len = strlen(tok+2)+1; + memmove( tok+1, tok+2, len ); } } @@ -365,7 +368,8 @@ char *src; if( (e = Basename(s)) != s) { if( !(mod & DIRECTORY_FLAG) ) { /* Move the basename to the start. */ - strcpy(s, e); + size_t len = strlen(e)+1; + memmove(s, e, len); } else s = e; @@ -382,7 +386,8 @@ char *src; if( !(mod & FILE_FLAG) ) { /* Move the suffix to the start. */ - strcpy( s, e ); + size_t len = strlen(e)+1; + memmove(s, e, len); } else s = e; @@ -725,8 +730,10 @@ int doexpand; /* If TRUE enables macro expansion */ done = !lev; break; } else { + size_t len; s[1] = ' '; - strcpy( s, s+1 ); + len = strlen(s+1)+1; + memmove( s, s+1, len ); } /*FALLTHRU*/ case ' ': @@ -835,8 +842,10 @@ int doexpand; /* If TRUE enables macro expansion */ * converted them to a real space. Let's verify this. */ for( p=s; *p && *p != edelim && *p; p++ ) { if( p[0] == '\\' && p[1] == '\n' ) { + size_t len; p[1] = ' '; - strcpy( p, p+1 ); + len = strlen(p+1)+1; + memmove( p, p+1, len ); } } if( !*p ) @@ -1120,7 +1129,10 @@ int *flag; *flag = 1; res = Expand( start ); - if( (t = DmStrSpn( res, " \t" )) != res ) strcpy( res, t ); + if( (t = DmStrSpn( res, " \t" )) != res ) { + size_t len = strlen(t)+1; + memmove( res, t, len ); + } } FREE( start ); /* this is ok! start is assigned a DmSubStr above */ diff --git a/dmake/getinp.c b/dmake/getinp.c index d736f50320a2..5445193d1a90 100644 --- a/dmake/getinp.c +++ b/dmake/getinp.c @@ -169,7 +169,8 @@ do_again: * text lines on input. The maximum size of this is governened by * Buffer_size */ if( q != p && q[-1] == CONTINUATION_CHAR ) { - strcpy( q, q+1 ); + size_t len = strlen(q+1)+1; + memmove( q, q+1, len ); q--; cont = FALSE; } @@ -290,7 +291,8 @@ int keep; while( (c = strchr(c, COMMENT_CHAR)) != NIL(char) ) { if( Comment || State == NORMAL_SCAN ) if( c != str && c[-1] == ESCAPE_CHAR ) { - strcpy( c-1, c ); /* copy it left, due to \# */ + size_t len = strlen(c)+1; + memmove( c-1, c, len ); /* copy it left, due to \# */ if( pend ) (*pend)--; /* shift tail pointer left */ } else { diff --git a/dmake/make.c b/dmake/make.c index c8f5eea7f48d..67af0653d35f 100644 --- a/dmake/make.c +++ b/dmake/make.c @@ -251,8 +251,9 @@ Make_targets()/* for( lp = Targets->ce_prq; lp != NIL(LINK); lp = lp->cl_next ) { CELLPTR tgt = lp->cl_prq; - if( !(tgt->ce_attr & A_UPDATED) ) - printf( "`%s' is up to date\n", tgt->CE_NAME ); + if( !(tgt->ce_attr & A_UPDATED) + && (Verbose & V_MAKE) ) + printf( "`%s' is up to date\n", tgt->CE_NAME ); } DB_RETURN( 0 ); @@ -1352,8 +1353,10 @@ CELLPTR cp; * Nothing in Expand() should be able to change dynamic macros. */ cmnd = Expand( rp->st_string ); - if( new_attr && (p = DmStrSpn(cmnd," \t\n+-@%")) != cmnd ) - strcpy(cmnd,p); + if( new_attr && (p = DmStrSpn(cmnd," \t\n+-@%")) != cmnd ) { + size_t len = strlen(p)+1; + memmove(cmnd,p,len); + } /* COMMAND macro is set to "$(CMNDNAME) $(CMNDARGS)" by default, it is * possible for the user to reset it to, for example @@ -1381,8 +1384,10 @@ CELLPTR cp; shell = ((l_attr & A_SHELL) != 0); /* clean up the attributes that we may have just added. */ - if( (p = DmStrSpn(cmnd," \t\n+-@%")) != cmnd ) - strcpy(cmnd,p); + if( (p = DmStrSpn(cmnd," \t\n+-@%")) != cmnd ) { + size_t len = strlen(p)+1; + memmove(cmnd,p,len); + } } #if defined(MSDOS) @@ -1477,8 +1482,9 @@ int map; for( p=cmnd; *(n = DmStrPbrk(p,tmp)) != '\0'; ) /* Remove the \<nl> sequences. */ if(*n == CONTINUATION_CHAR && n[1] == '\n') { + size_t len = strlen(n+2)+1; DB_PRINT( "make", ("fixing [%s]", p) ); - strcpy( n, n+2 ); + memmove( n, n+2, len ); p = n; } /* Look for an escape sequence and replace it by it's corresponding diff --git a/dmake/path.c b/dmake/path.c index d5dea553afb6..ead163394175 100644 --- a/dmake/path.c +++ b/dmake/path.c @@ -172,6 +172,7 @@ char *path; char *tpath; int hasdriveletter = 0; int delentry; + size_t len; DB_ENTER( "Clean_path" ); @@ -231,14 +232,16 @@ char *path; p++; } while( *p == *DirSepStr); - strcpy(t+1,p); + len = strlen(p)+1; + memmove(t+1,p,len); continue; } /* Remove './'. If OOODMAKEMODE is set do this only if it is not at * the start of the path. */ if ( p-q == 1 && *q == '.' && (q != path || !STOBOOL(OOoDmMode)) ) { - strcpy(q,p+1); + len = strlen(p+1)+1; + memmove(q,p+1,len); q = tpath; continue; } @@ -268,7 +271,8 @@ char *path; } while( *t == *DirSepStr); /* q points to first letter of the current directory/file. */ - strcpy(q,t); + len = strlen(t)+1; + memmove(q,t,len); q = tpath; } else diff --git a/dmake/rulparse.c b/dmake/rulparse.c index 338e77e8ad09..af7915fb129b 100644 --- a/dmake/rulparse.c +++ b/dmake/rulparse.c @@ -897,7 +897,7 @@ CELLPTR prereq; /* list of prerequisites */ /* Handle %-targets. */ CELLPTR cur; CELLPTR tpq = NIL(CELL); - CELLPTR nprq; + CELLPTR nprq = NULL; #ifdef DBUG DB_PRINT( "%", ("Handling %%-target [%s : : <prerequisites follow, maybe empty>]", @@ -915,7 +915,8 @@ CELLPTR prereq; /* list of prerequisites */ if( *name == '\'' && name[len-1]=='\'' ){ name[len-1] = '\0'; - strcpy(name,name+1); + len = strlen(name+1)+1; + memmove(name,name+1,len); /* add indirect prerequisite */ _add_indirect_prereq( cur ); } diff --git a/dmake/tests/misc-13 b/dmake/tests/misc-13 index a2381a8c00cc..7493e744b6b6 100755 --- a/dmake/tests/misc-13 +++ b/dmake/tests/misc-13 @@ -38,7 +38,7 @@ TeSt.target : EOT -output=`eval ${DMAKEPROG} -r -f $file1` +output=`eval ${DMAKEPROG} -vm -r -f $file1` result=$? if echo "$output" | grep -v ".target' is up to date" > /dev/null 2>&1 ; then diff --git a/dmake/tests/misc-15 b/dmake/tests/misc-15 index 1c52324a88d5..a213c2d885af 100755 --- a/dmake/tests/misc-15 +++ b/dmake/tests/misc-15 @@ -37,7 +37,7 @@ MYTARGET:=\$(PWD)/target.abc EOT -output=`eval ${DMAKEPROG} -r -f $file1` +output=`eval ${DMAKEPROG} -vm -r -f $file1` result=$? if echo "$output" | grep "target.abc' is up to date" > /dev/null 2>&1 ; then diff --git a/dmake/tests/targets-28 b/dmake/tests/targets-28 index da202b0d2025..0943eb6677ff 100755 --- a/dmake/tests/targets-28 +++ b/dmake/tests/targets-28 @@ -112,10 +112,10 @@ sleep 1 # This tests that aa.x is not build as the dependency chain is intact with # the virtual target aa.y having the same time stamp as aa.z. -output3=`eval ${DMAKEPROG} -rf $file1 2>&1` +output3=`eval ${DMAKEPROG} -vm -rf $file1 2>&1` result3=$? -if test $result3 = 0 -a "$output3" = "\`aa.x' is up to date" ; then +if test $result3 = 0 && echo "$output3" | grep "aa.x' is up to date" > /dev/null 2>&1 ; then echo "Subtest 3: OK" result3=0 else diff --git a/dmake/unix/runargv.c b/dmake/unix/runargv.c index 5979d04bc546..4be342bbb273 100644 --- a/dmake/unix/runargv.c +++ b/dmake/unix/runargv.c @@ -553,8 +553,11 @@ char **cmd; /* Simulate a reference to *cmd. */ /* Restore stdout/stderr if needed. */ if( old_stdout != -1 ) { dup2(old_stdout, 1); - if( old_stderr != -1 ) + close(old_stdout); + if( old_stderr != -1 ) { dup2(old_stderr, 2); + close(old_stderr); + } } internal = 1; @@ -593,8 +596,11 @@ char **cmd; /* Simulate a reference to *cmd. */ if( old_stdout != -1 ) { dup2(old_stdout, 1); - if( old_stderr != -1 ) + close(old_stdout); + if( old_stderr != -1 ) { dup2(old_stderr, 2); + close(old_stderr); + } } if(pid.pid == (DMHANDLE)-1) { /* spawn failed */ @@ -649,8 +655,11 @@ char **cmd; /* Simulate a reference to *cmd. */ * failed. */ if( old_stdout != -1 ) { dup2(old_stdout, 1); - if( old_stderr != -1 ) + close(old_stdout); + if( old_stderr != -1 ) { dup2(old_stderr, 2); + close(old_stderr); + } } fprintf(stderr, "%s: Error executing '%s': %s", Pname, argv[0], strerror(errno) ); |