/* * Copyright 1993-2002 Christopher Seiwald and Perforce Software, Inc. * * This file is part of Jam - see jam.c for Copyright information. */ # include "jam.h" # include "lists.h" # include "search.h" # include "timestamp.h" # include "pathsys.h" # include "variable.h" # include "newstr.h" /* * search.c - find a target along $(SEARCH) or $(LOCATE) */ char * search( char *target, time_t *time ) { PATHNAME f[1]; LIST *varlist; char buf[ MAXJPATH ]; /* Parse the filename */ path_parse( target, f ); f->f_grist.ptr = 0; f->f_grist.len = 0; if( varlist = var_get( "LOCATE" ) ) { f->f_root.ptr = varlist->string; f->f_root.len = strlen( varlist->string ); path_build( f, buf, 1 ); if( DEBUG_SEARCH ) printf( "locate %s: %s\n", target, buf ); timestamp( buf, time ); return newstr( buf ); } else if( varlist = var_get( "SEARCH" ) ) { while( varlist ) { f->f_root.ptr = varlist->string; f->f_root.len = strlen( varlist->string ); path_build( f, buf, 1 ); if( DEBUG_SEARCH ) printf( "search %s: %s\n", target, buf ); timestamp( buf, time ); if( *time ) return newstr( buf ); varlist = list_next( varlist ); } } /* Look for the obvious */ /* This is a questionable move. Should we look in the */ /* obvious place if SEARCH is set? */ f->f_root.ptr = 0; f->f_root.len = 0; path_build( f, buf, 1 ); if( DEBUG_SEARCH ) printf( "search %s: %s\n", target, buf ); timestamp( buf, time ); return newstr( buf ); }
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#3 | 1317 | Richard Geiger |
Update the copyright notices in all files touched in the upcoming drop into //public/jam/ |
||
#2 | 1240 | Richard Geiger |
Split jam's pathsys.h from filesys.h, since they are really two different pieces. === computer.perforce.com:1666: Change 19938 by seiwald@spice on 2001/01/08 21:46:33 Added note in RELNOTES about the internal code change - rmg |
||
#1 | 1207 | Richard Geiger | Establish this branch to use for import of Perforce Jam. | ||
//guest/perforce_software/jam/src/search.c | |||||
#2 | 486 | Perforce staff |
Jam 2.3. See RELNOTES for a list of changes from 2.2.x. Just about every source file was touched when jam got ANSI-fied. |
||
#1 | 2 | laura | Add Jam/MR 2.2 source |