aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/make/dir.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove old fmake. It wasn't built by default for some time. Users thatWarner Losh2015-06-161-1217/+0
| | | | | | | | | | really need it can find it in the devel/fmake port or pkg install fmake. Note: This commit is orthogonal to the question 'can we fmake buildworld'. Differential Revision: https://reviews.freebsd.org/D2840 Notes: svn path=/head/; revision=284464
* Add ability to search up the directory hierarchy for the system directory.David E. O'Brien2010-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) Notes: svn path=/head/; revision=201526
* Remove unnecessary includes.Xin LI2009-12-111-2/+0
| | | | | | | Reviewed by: rodrigc Notes: svn path=/head/; revision=200417
* Catch up with r144020's /Dir_FindFile/Path_FindFile/David E. O'Brien2009-11-171-1/+1
| | | | Notes: svn path=/head/; revision=199419
* Garbage collect some old #ifdef'ed code from 1994 that causes vi's '%'David E. O'Brien2009-11-171-16/+0
| | | | | | | to be unable to find a match in Path_FindFile(). Notes: svn path=/head/; revision=199404
* Make paths an explicite datatype instead of using the generic Lst.Hartmut Brandt2005-03-231-213/+188
| | | | | | | | | 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. Notes: svn path=/head/; revision=144020
* Style: <space><tab> -> <tab>Hartmut Brandt2005-03-221-34/+33
| | | | Notes: svn path=/head/; revision=143979
* Rename struct Path to struct Dir and move it into the C-file. ItHartmut Brandt2005-03-221-20/+29
| | | | | | | is not used outside. Notes: svn path=/head/; revision=143978
* Fix a comment.Hartmut Brandt2005-03-161-3/+1
| | | | Notes: svn path=/head/; revision=143685
* Use the new LST_FOREACH macro throughout the file and replace calls toHartmut Brandt2005-02-221-70/+20
| | | | | | | Lst_ForEach and Lst_Find. Notes: svn path=/head/; revision=142209
* Some more easy constification.Hartmut Brandt2005-02-041-2/+2
| | | | | | | Submitted by: Max Okumoto <okumoto@ucsd.edu> Notes: svn path=/head/; revision=141252
* Clean up include files and file including. Split nonints.h into piecesHartmut Brandt2005-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> Notes: svn path=/head/; revision=141104
* Remove all the cleanup functions. There is no reason to free memoryHartmut Brandt2004-12-171-27/+0
| | | | | | | | just before exiting (especially given the number of memory leaks) - it just costs time. Notes: svn path=/head/; revision=138972
* Instead of dynamically allocating list heads allocated them staticallyHartmut Brandt2004-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. Notes: svn path=/head/; revision=138916
* If a path element directory was never opened it is not on the list ofHartmut Brandt2004-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. Notes: svn path=/head/; revision=138621
* Get rid of the sequential access feature of the lists. This was usedHartmut Brandt2004-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. Notes: svn path=/head/; revision=138564
* Constify the arguments to the list compare function. This temporarilyHartmut Brandt2004-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) Notes: svn path=/head/; revision=138561
* Consify the arguments to str_concat. Remove the STR_DOFREE flag for thatHartmut Brandt2004-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> Notes: svn path=/head/; revision=138547
* Typedefs of pointers to structs are evil. Make Lst and LstNode typedef ofHartmut Brandt2004-12-071-20/+20
| | | | | | | | | the structs itself not of pointers to them. This will simplify constification. Checked by: diff on the object files Notes: svn path=/head/; revision=138512
* Make needs no circular lists so remove them from the list code.Hartmut Brandt2004-12-071-3/+3
| | | | Notes: svn path=/head/; revision=138510
* Some constification which doesn't require code rewrites.Hartmut Brandt2004-12-061-12/+8
| | | | Notes: svn path=/head/; revision=138455
* Style: fix indentation.Hartmut Brandt2004-12-061-611/+628
| | | | Notes: svn path=/head/; revision=138441
* Style: remove a lot of unnecessary casts, add some and spell the nullHartmut Brandt2004-12-011-45/+46
| | | | | | | | | pointer constant as NULL. Checked by: diff -r on the object files before and after Notes: svn path=/head/; revision=138264
* Stylification: missing spaces, extra space after function names, castsHartmut Brandt2004-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) Notes: svn path=/head/; revision=138232
* Change a couple of the primitve list functions to be macros. This changesHartmut Brandt2004-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. Notes: svn path=/head/; revision=138222
* Fix a bug that prevented exists() from finding "foo/", "foo/."Ruslan Ermilov2003-10-021-3/+8
| | | | | | | | | and "foo/.." when ".PATH: foo" was also given. PR: bin/34062 Notes: svn path=/head/; revision=120676
* - Cut out the code that caches the "." directory out of Dir_Init()Ruslan Ermilov2003-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 Notes: svn path=/head/; revision=120053
* Convert make(1) to use ANSI style function declarations. VariableJuli Mallett2002-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. Notes: svn path=/head/; revision=104696
* Fix merge error in previous commit.Juli Mallett2002-09-281-1/+1
| | | | | | | Sponsored by: Bright Path Solutions Notes: svn path=/head/; revision=104109
* Add empty default cases where they should be, remove non-local execution stuffJuli Mallett2002-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 Notes: svn path=/head/; revision=104108
* Make the DEBUGF() macro portable by (ugh) adding a Debug() function, whichJuli Mallett2002-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. Notes: svn path=/head/; revision=103545
* Move common use of if (DEBUG(FOO)) printf... to DEBUGF(FOO, ...), usingJuli Mallett2002-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. Notes: svn path=/head/; revision=103508
* #define<space> -> #define<tab>Juli Mallett2002-09-171-1/+1
| | | | Notes: svn path=/head/; revision=103503
* Look for wildcards, and balanced meta-characters such as { and } like NetBSDJuli Mallett2002-06-201-2/+18
| | | | | | | | | does. Obtained from: NetBSD Notes: svn path=/head/; revision=98502
* Remove a stray asterisk in a comment.Juli Mallett2002-06-011-1/+1
| | | | Notes: svn path=/head/; revision=97686
* More consistancy. file system > filesystemTom Rhodes2002-05-161-1/+1
| | | | Notes: svn path=/head/; revision=96704
* Fix copyrights, and undo SCS ID damage.David E. O'Brien2002-04-131-1/+2
| | | | Notes: svn path=/head/; revision=94589
* Update SCM ID method.David E. O'Brien2002-04-131-3/+1
| | | | Notes: svn path=/head/; revision=94587
* De'register.David E. O'Brien2002-04-131-8/+8
| | | | Notes: svn path=/head/; revision=94584
* remove __PWarner Losh2002-03-221-6/+6
| | | | Notes: svn path=/head/; revision=92921
* -Wall cleanup.Ruslan Ermilov2001-04-251-1/+2
| | | | Notes: svn path=/head/; revision=75975
* Fix nasty bug where make(1) assumed that you could read the directory itWill Andrews2001-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) Notes: svn path=/head/; revision=72310
* Fix style(9) bug; use ISDOT[DOT,]() macro available in util.c by movingWill Andrews2001-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 Notes: svn path=/head/; revision=71325
* Fix for the case where the first two entries returned by readdir() areWill Andrews2000-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> Notes: svn path=/head/; revision=70358
* There's also no point in #typedef'ing void/char pointers. Accordingly,Will Andrews2000-12-021-27/+27
| | | | | | | | | rip out ClientData/Address pointers and use standard types. Obtained from: OpenBSD Notes: svn path=/head/; revision=69531
* There's no reason to use fancy forms of NULL. Replace all instancesWill Andrews2000-12-021-10/+10
| | | | | | | | | of NIL, NILLST, NILLGNODE, etc. with NULL. Obtained from: OpenBSD Notes: svn path=/head/; revision=69527
* Use __RCSID()Wilfredo Sanchez2000-07-091-6/+4
| | | | Notes: svn path=/head/; revision=62833
* Unduplicate IDs from comments, do $Id -> $FreeBSD$ (submitted-by: bde)Tim Vanderhoek1999-09-111-3/+1
| | | | Notes: svn path=/head/; revision=51150
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50477
* Merge style- and trivial- only changes from OpenBSD (dated 1999/07/29-19:55+1).Tim Vanderhoek1999-08-171-1/+6
| | | | | | | Obtained from: OpenBSD, sometimes indirected from NetBSD; myself Notes: svn path=/head/; revision=49938