diff options
author | Kurt Zenker <kz@openoffice.org> | 2008-03-05 17:29:34 +0000 |
---|---|---|
committer | Kurt Zenker <kz@openoffice.org> | 2008-03-05 17:29:34 +0000 |
commit | 044f4362e7775d4de054c9d9bd22fd7227dbada2 (patch) | |
tree | 82c98d6a4de6ec858a4e338cba6da5e0212f7054 /dmake | |
parent | 4bd90d554d7abb3f32a20f28da89d3b451290a38 (diff) |
INTEGRATION: CWS dmake412_DEV300 (1.5.2); FILE MERGED
2008/01/07 06:07:15 vq 1.5.2.1: #i84800# Do not collaps the foo/.. entries if foo is '.' or '..'.
Diffstat (limited to 'dmake')
-rw-r--r-- | dmake/path.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/dmake/path.c b/dmake/path.c index 3dd21616b3dc..d5dea553afb6 100644 --- a/dmake/path.c +++ b/dmake/path.c @@ -1,4 +1,4 @@ -/* RCS $Id: path.c,v 1.5 2007-10-15 15:40:58 ihi Exp $ +/* RCS $Id: path.c,v 1.6 2008-03-05 18:29:34 kz Exp $ -- -- SYNOPSIS -- Pathname manipulation code @@ -171,6 +171,7 @@ char *path; register char *q; char *tpath; int hasdriveletter = 0; + int delentry; DB_ENTER( "Clean_path" ); @@ -218,6 +219,7 @@ char *path; while( *q ) { char *t; + /* p is NULL or greater than q. */ p=strchr(q, *DirSepStr); if( !p ) break; @@ -245,7 +247,20 @@ char *path; t=strchr(p+1, *DirSepStr); if( !t ) break; - if ( !(p-q == 2 && strncmp(q,"..",2) == 0) + /* Collaps this only if foo is neither '.' nor '..'. */ + switch( p-q ) { + case 2: + delentry = !((q[0] == '.') && (q[1] == '.')); + break; + case 1: + delentry = !(q[0] == '.'); + break; + default: + delentry = TRUE; + break; + } + + if ( delentry && (t-p-1 == 2 && strncmp(p+1,"..",2) == 0) ) { /* Skip one (or possible more) DirSepStr. */ do { |