diff options
author | Ivo Hinkelmann <ihi@openoffice.org> | 2007-10-15 14:38:09 +0000 |
---|---|---|
committer | Ivo Hinkelmann <ihi@openoffice.org> | 2007-10-15 14:38:09 +0000 |
commit | 8b8a491ab8b382b242c1d65a6426a4c8d0f1459b (patch) | |
tree | a13959ffcc42d42f8567517876d736714f42c867 /dmake/dag.c | |
parent | INTEGRATION: CWS dmake411 (1.29.2); FILE MERGED (diff) | |
download | core-8b8a491ab8b382b242c1d65a6426a4c8d0f1459b.tar.gz core-8b8a491ab8b382b242c1d65a6426a4c8d0f1459b.zip |
INTEGRATION: CWS dmake411 (1.10.2); FILE MERGED
2007/07/24 23:00:26 vq 1.10.2.1: #i78776# New function macro $(normpath[,para] list) to normalise the
elements of list and a macro extension $(macro_name:n) to normalise
the content of macro_name. The normalization is done token-wise and
quotes are preserved.
On cygwin the result honors the setting of .WINPATH to determine the
output format. If the optional parameter para is given in the
$(normpath ...) case its expanded value is used to override the
.WINPATH setting for the output of the function macro.
Diffstat (limited to 'dmake/dag.c')
-rw-r--r-- | dmake/dag.c | 64 |
1 files changed, 3 insertions, 61 deletions
diff --git a/dmake/dag.c b/dmake/dag.c index e06165ece7af..41a52e5a0273 100644 --- a/dmake/dag.c +++ b/dmake/dag.c @@ -1,6 +1,6 @@ /* $RCSfile: dag.c,v $ --- $Revision: 1.10 $ --- last change: $Author: rt $ $Date: 2007-07-03 11:29:33 $ +-- $Revision: 1.11 $ +-- last change: $Author: ihi $ $Date: 2007-10-15 15:38:09 $ -- -- SYNOPSIS -- Routines to construct the internal dag. @@ -27,12 +27,6 @@ */ #include "extern.h" -#if __CYGWIN__ -#include <sys/cygwin.h> -#include <errno.h> -#endif - -static char *_normalize_path(char *path); static void @@ -479,7 +473,7 @@ char *name; DB_PRINT( "path", ("Normalizing [%s]", name) ); /* The normalizing function returns a pointer to a static buffer. */ - name =_normalize_path(name); + name = normalize_path(name); hp = Get_name( name, Defs, TRUE );/* get the name from hash table */ @@ -692,55 +686,3 @@ char *rp; return(flag); } - - -static char * -_normalize_path(path)/* -======================= - Normalize the given path unless it contains a $ indicating a dynamic - prerequisite. - Special case: For absolute DOSish paths under cygwin a cygwin API - function is used to normalize the path optherwise Clean_path() is used. - - Note, the returned path is built in a static buffer, if it is to be used - later a copy should be created. */ - -char *path; -{ - static char *cpath = NIL(char); - - DB_ENTER( "_normalize_path" ); - - if ( !cpath && ( (cpath = MALLOC( PATH_MAX, char)) == NIL(char) ) ) - No_ram(); - - /* If there is a $ in the path this can either mean a '$' character in - * a target definition or a dynamic macro expression in a prerequisite - * list. As dynamic macro expression must not be normalized and is - * indistinguishable from a literal $ characters at this point we skip - * the normalization if a $ is found. */ - if( strchr(path, '$') ) { - DB_RETURN( path ); - } - -#if __CYGWIN__ - /* Use cygwin function to convert a DOS path to a POSIX path. */ - if( *path && path[1] == ':' && isalpha(*path) ) { - int err = cygwin_conv_to_posix_path(path, cpath); - if (err) - Fatal( "error converting \"%s\" - %s\n", - path, strerror (errno)); - if( path[2] != '/' && path[2] != '\\' ) - Warning("Malformed DOS path %s converted to %s", path, cpath); - } - else -#endif - { - strcpy( cpath, path ); - Clean_path( cpath ); - } - - DB_PRINT( "path", ("normalized: %s", cpath )); - - DB_RETURN( cpath ); -} |