summaryrefslogtreecommitdiffstats
path: root/usr.bin/make/dir.c
Commit message (Collapse)AuthorAgeFilesLines
* Add ability to search up the directory hierarchy for the system directory.obrien2010-01-041-1/+82
| | | | | | | Do by specifying ".../" with '-m' or MAKESYSPATH (new) environment variable. Reviewed by: <sjg@NetBSD.org> Obtained from: NetBSD (+ embellishment by me, sent back to NetBSD)
* Remove unnecessary includes.delphij2009-12-111-2/+0
| | | | Reviewed by: rodrigc
* Catch up with r144020's /Dir_FindFile/Path_FindFile/obrien2009-11-171-1/+1
|
* Garbage collect some old #ifdef'ed code from 1994 that causes vi's '%'obrien2009-11-171-16/+0
| | | | to be unable to find a match in Path_FindFile().
* Make paths an explicite datatype instead of using the generic Lst.harti2005-03-231-214/+189
| | | | | | A Path is now a TAILQ of PathElements each of which just points to a reference counted directory. Rename all functions dealing with Paths from the Dir_ prefix to a Path_ prefix.
* Style: <space><tab> -> <tab>harti2005-03-221-34/+33
|
* Rename struct Path to struct Dir and move it into the C-file. Itharti2005-03-221-20/+29
| | | | is not used outside.
* Fix a comment.harti2005-03-161-3/+1
|
* Use the new LST_FOREACH macro throughout the file and replace calls toharti2005-02-221-70/+20
| | | | Lst_ForEach and Lst_Find.
* Some more easy constification.harti2005-02-041-2/+2
| | | | Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Clean up include files and file including. Split nonints.h into piecesharti2005-02-011-4/+15
| | | | | | | | | | | | | that get included just where they are needed. All headers include the headers that they need to compile (just with an empty .c file). Sort includes alphabetically where apropriate and fix some duplicate commenting for struct Job, struct GNode and struct Shell by removing one version and inlining the comments into the structure declaration (the comments have been somewhat outdated). This patch does not contain functional changes (checked with md5). Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Remove all the cleanup functions. There is no reason to free memoryharti2004-12-171-27/+0
| | | | | just before exiting (especially given the number of memory leaks) - it just costs time.
* Instead of dynamically allocating list heads allocated them staticallyharti2004-12-161-21/+21
| | | | | | | | now that their size is only two pointers. This eliminates a lot of calls to Lst_Init and from there to malloc together with many calls to Lst_Destroy (in places where the list is obviously empty). This also reduces the chance to leave a list uninitilized so we can remove more NULL pointer checks and probably eliminates a couple of memory leaks.
* If a path element directory was never opened it is not on the list ofharti2004-12-091-2/+2
| | | | | open directories so there is no need to remove it from there. This fixes a core dump introduced by removing the run-time check from Lst_Remove.
* Get rid of the sequential access feature of the lists. This was usedharti2004-12-081-39/+14
| | | | | | | | only in a couple of places and all of them except for one were easily converted to use Lst_First/Lst_Succ. The one place is compatibility mode in job.c where the it was used to advance to the next command on each invocation of JobStart. For this case add a pointer to the node to hold the currently executed command.
* Constify the arguments to the list compare function. This temporarilyharti2004-12-081-3/+2
| | | | | | | | requires to make a copy of the filename in ReadMakefile and to duplicate two small functions in suff.c. This hopefully will go away when everything is constified. Submitted by: Max Okumoto <okumoto@ucsd.edu> (partly)
* Consify the arguments to str_concat. Remove the STR_DOFREE flag for thatharti2004-12-081-1/+5
| | | | | | | purpose and explicitely free the input string in the one place that was calling str_concat with that flag. Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Typedefs of pointers to structs are evil. Make Lst and LstNode typedef ofharti2004-12-071-20/+20
| | | | | | the structs itself not of pointers to them. This will simplify constification. Checked by: diff on the object files
* Make needs no circular lists so remove them from the list code.harti2004-12-071-3/+3
|
* Some constification which doesn't require code rewrites.harti2004-12-061-12/+8
|
* Style: fix indentation.harti2004-12-061-638/+655
|
* Style: remove a lot of unnecessary casts, add some and spell the nullharti2004-12-011-45/+46
| | | | | | pointer constant as NULL. Checked by: diff -r on the object files before and after
* Stylification: missing spaces, extra space after function names, castsharti2004-11-301-100/+107
| | | | | | | | and the sizeof operator, missing empty lines, void casts, extra empty lines. Checked by: diff on make *.o lst.lib/*.o Submitted by: Max Okumoto <okumoto@soe.ucsd.edu> (partly)
* Change a couple of the primitve list functions to be macros. This changesharti2004-11-301-2/+4
| | | | | | the semantic of Lst_Datum which formerly returned NULL when the argument node was NULL. There was only one place in the source that relied on this so change that place.
* Fix a bug that prevented exists() from finding "foo/", "foo/."ru2003-10-021-3/+8
| | | | | | and "foo/.." when ".PATH: foo" was also given. PR: bin/34062
* - Cut out the code that caches the "." directory out of Dir_Init()ru2003-09-141-9/+20
| | | | | | | | | | into a separate function, Dir_InitDot(). - Postpone the current and object directories detection (and caching of the "." directory) until after all command line arguments are parsed. This makes the -C option DTRT. PR: bin/47149
* Convert make(1) to use ANSI style function declarations. Variablejmallett2002-10-091-62/+32
| | | | | | | | | | | documentation already adequatedly existed in the description in most cases. Where it did not, it was added. If no documentation existed beforehand, then none was added. Some unused dummies for use in the traversal functions were marked as __unused during the conversion. Occasionally, local style fixes were applied to lines already being modified or influenced. Now make(1) should always build with WARNS=3.
* Fix merge error in previous commit.jmallett2002-09-281-1/+1
| | | | Sponsored by: Bright Path Solutions
* Add empty default cases where they should be, remove non-local execution stuffjmallett2002-09-281-0/+2
| | | | | | | | | | in compat.c which doesn't even have preprocessor-conditional-hidden support code, and add a debugging statement where we might end up with a nil list somehow, but where I doubt it. First confirmed userland kill for Flexelint. Sponsored by: Bright Path Solutions
* Make the DEBUGF() macro portable by (ugh) adding a Debug() function, whichjmallett2002-09-181-26/+26
| | | | | is merely printf() but to stderr. This takes care of the caveat which lead to the use of a vararg macro -- getting everything to stderr.
* Move common use of if (DEBUG(FOO)) printf... to DEBUGF(FOO, ...), usingjmallett2002-09-171-77/+27
| | | | | | | | | variable length arguments to a macro. Bump version as this makes DEBUG statements *always* go to stderr rather than sometimes stdout. There are a few stragglers, which I will take care of as soon as I can. Mostly these relate to the need-for-death-of some of the remote job code. Nearby stylistic nits and XXX added/fixed where appropriate.
* #define<space> -> #define<tab>jmallett2002-09-171-1/+1
|
* Look for wildcards, and balanced meta-characters such as { and } like NetBSDjmallett2002-06-201-2/+18
| | | | | | does. Obtained from: NetBSD
* Remove a stray asterisk in a comment.jmallett2002-06-011-1/+1
|
* More consistancy. file system > filesystemtrhodes2002-05-161-1/+1
|
* Fix copyrights, and undo SCS ID damage.obrien2002-04-131-1/+2
|
* Update SCM ID method.obrien2002-04-131-3/+1
|
* De'register.obrien2002-04-131-8/+8
|
* remove __Pimp2002-03-221-6/+6
|
* -Wall cleanup.ru2001-04-251-1/+2
|
* Fix nasty bug where make(1) assumed that you could read the directory itwill2001-02-101-0/+2
| | | | | | | | | was in. This shall be MFC'd in about three days (probably not a good idea to MFC the stylistic changes though - see below). PR: 19978 Submitted by: Gerald Pfeifer <pfeifer@dbai.tuwien.ac.at> Patch by: roam (slightly modified by me to use NULL not NIL)
* Fix style(9) bug; use ISDOT[DOT,]() macro available in util.c by movingwill2001-01-211-8/+7
| | | | | | | it to make.h so both dir.c and util.c can use it, although bde didn't particularly like this part of the idea, IMO it's cleaner than it was. Submitted by: bde
* Fix for the case where the first two entries returned by readdir() arewill2000-12-261-6/+12
| | | | | | | | | | | | actually NOT '.' and '..'. Apparently this isn't the case when accessing a directory via XFS over NFS on SGI systems. Since I don't have access to an environment like that, this will sit out in -current for at least six weeks. However, the patch proposed by the submitter seems acceptable, so I've decided to commit it to the tree, in the hope that it will solve some problems without bringing up others. PR: 23300 Submitted by: Jim Pirzyk <Jim.Pirzyk@disney.com>
* There's also no point in #typedef'ing void/char pointers. Accordingly,will2000-12-021-27/+27
| | | | | | rip out ClientData/Address pointers and use standard types. Obtained from: OpenBSD
* There's no reason to use fancy forms of NULL. Replace all instanceswill2000-12-021-10/+10
| | | | | | of NIL, NILLST, NILLGNODE, etc. with NULL. Obtained from: OpenBSD
* Use __RCSID()wsanchez2000-07-091-6/+4
|
* Unduplicate IDs from comments, do $Id -> $FreeBSD$ (submitted-by: bde)hoek1999-09-111-3/+1
|
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Merge style- and trivial- only changes from OpenBSD (dated 1999/07/29-19:55+1).hoek1999-08-171-1/+6
| | | | Obtained from: OpenBSD, sometimes indirected from NetBSD; myself
* Revert $FreeBSD$ to $Id$peter1997-02-221-1/+1
|
OpenPOWER on IntegriCloud