summaryrefslogtreecommitdiffstats
path: root/usr.bin/make/str.c
Commit message (Collapse)AuthorAgeFilesLines
* Make the ArgArray_Init() function visible to the rest of make.harti2005-05-231-1/+1
| | | | It will soon be needed for the .SHELL parsing code.
* Get rid of global variables for argument vectors produced by brk_string()harti2005-05-181-135/+176
| | | | | | | | introduce a struct that holds all the information about an argument vector and pass that around. Author: Max Okumoto <okumoto@ucsd.edu> Obtained from: DragonFlyBSD
* The first element of the vector built by brk_string() is neverharti2005-05-121-8/+8
| | | | | | | used so there is no need to stuff the value of .MAKE into it, which btw isn't set for quite a while already. Submitted by: Max Okumoto <okumoto@ucsd.edu> (7.239)
* Style: fix indentation.harti2005-04-011-63/+51
|
* Constify the input argument to brk_string.harti2005-03-071-2/+4
| | | | | | Patch: 7.106 Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Invent a Buf_AppendRange function that appends a non-NUL-terminated stringharti2005-02-071-1/+1
| | | | | | | given by a pointer to the start of the string and a pointer one behind the end. Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Invent a Buf_Append function to append a NUL-terminated stringharti2005-02-071-1/+1
| | | | | | and use it thoughout the code. Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Minor cleanup: make brk_string to return argc only if the pointer to itharti2005-02-041-1/+2
| | | | | | | | | was non-NULL. This let's us eliminated an otherwise unused variable. shellneeded can never return -1 so there is no need to check for it and hence no need for a variable to hold the returned value. Submitted by: Max Okumoto <okumoto@ucsd.edu> (partly)
* Convert several typedefs from beeing pointers to structs to be the structsharti2005-02-021-1/+2
| | | | | | | itself. This will ease constification (think of what 'const Ptr foo' means if Ptr is a pointer to a struct). Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Clean up include files and file including. Split nonints.h into piecesharti2005-02-011-1/+8
| | | | | | | | | | | | | 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>
* Fix quoting of the MAKEFLAGS environment variable by only quoting spacesharti2005-01-261-0/+99
| | | | | | | | | | and tabs. This is still not correct for command line variable values ending in a backslash because this would require a larger effort. Document this limitation in the BUGS section of the man page. The quoting is mostly compatible with that of gmake and smake. Tested by: Max Okumoto and Joerg Sonnenberger from DragonFly BSD Reviewed by: ru (man page, partly)
* Remove all the cleanup functions. There is no reason to free memoryharti2004-12-171-18/+0
| | | | | just before exiting (especially given the number of memory leaks) - it just costs time.
* Constify some calls of Buf_AddBytes.harti2004-12-081-3/+3
| | | | Submitted by: Max Okumoto <okumoto@ucsd.edu>
* Consify the arguments to str_concat. Remove the STR_DOFREE flag for thatharti2004-12-081-8/+2
| | | | | | | 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>
* Style: remove a lot of unnecessary casts, add some and spell the nullharti2004-12-011-6/+6
| | | | | | 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-23/+24
| | | | | | | | 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)
* Fixed a bug that previous revision has introduced -- we missedru2004-01-251-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | the double quotes ("" and '') as a separate argument. Reported by: ache The fix in this and previous revisions combined is functionally equivalent to the below patch against rev. 1.27 but the code is now much easier to follow: %%% Index: str.c =================================================================== RCS file: /home/ncvs/src/usr.bin/make/str.c,v retrieving revision 1.27 diff -u -r1.27 str.c --- str.c 28 Oct 2002 23:33:57 -0000 1.27 +++ str.c 25 Jan 2004 12:09:21 -0000 @@ -168,7 +168,7 @@ inquote = (char) ch; /* Don't miss "" or '' */ if (start == NULL && p[1] == inquote) { - start = t + 1; + start = t; break; } } %%%
* Fixed broken logic when parsing double quotes.ru2004-01-221-14/+5
| | | | | PR: bin/61673 MFC after: 1 month
* Split var.c into var.c and var_modify.c and move all the modification funcsjmallett2002-10-281-46/+9
| | | | | | | | to var_modify.c, for readability. constify some low hanging fruit (string manipulation functions) and the upper layers appropriately. No longer use the private strstr(3) implementation, while changing string code. Tested by: lots of successful make buildworld.
* Remove efree(), it isn't used consistently enough to even pretend that itjmallett2002-10-231-2/+2
| | | | | | might help on the systems it could possibly be used as a bandaid for. In fact, the only thing it's useful for is instrumenting free(3) calls, and in that capacity, it's better served as a local patch, than a public wrapper.
* Convert make(1) to use ANSI style function declarations. Variablejmallett2002-10-091-24/+10
| | | | | | | | | | | 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.
* Add empty default cases where they should be, remove non-local execution stuffjmallett2002-09-281-0/+4
| | | | | | | | | | 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
* str_concat() doesn't really take const arguments.jmallett2002-05-221-3/+3
| | | | | Submitted by: bde Pointy hat to: jmallett
* Replace the evil that is __DECONST() with (void *). This is one of the leastjmallett2002-05-221-2/+2
| | | | | | evil things we can do involving the const qualifier and a pointer. Submitted by: bde, ru
* Fix make(1) behaviour regarding SysV-style substitution when given a niljmallett2002-05-051-0/+6
| | | | | | | | left-hand-side. PR: bin/5297 Submitted by: "Matthew Emmerton" <matt@gsicomp.on.ca> MFC after: 1 week
* Back out rev 1.17, it breaks dependencies.obrien2002-04-141-15/+11
| | | | | | | With rev 1.7 one cannot build src/bin/sh -- because make fails to create the buildtools before trying to use them. Actually it does compile the buildtools into .o's before trying to use them, but not all the way into binaries.
* Revision 1.17 seems to break a subsequent buildworld (i.e. with the newobrien2002-04-131-2/+5
| | | | | | | | | | | make installed) in gnu/usr.bin/groff/src/preproc/eqn (which, being a build tool itself, is built with the original make during buildworld). The problem seems to be that in str_concat(), the string is not terminated when the length of the second string is 0. This apparently can happen during null suffix rule processing. Submitted by: tmm
* Update SCM ID method.obrien2002-04-131-3/+1
|
* Make str_concat handle NULL arguments properly (a-la how ODE-2.3.6 make does).obrien2002-04-131-12/+13
| | | | | Submitted by: jmallett Inspired by: CMU BUILDTOOLS4 coredumping, ODE-2.3.6 make(1)
* De'register.obrien2002-04-131-9/+9
|
* Constify str_concat()obrien2002-04-131-3/+3
| | | | Submitted by: jmallett
* There's also no point in #typedef'ing void/char pointers. Accordingly,will2000-12-021-1/+1
| | | | | | rip out ClientData/Address pointers and use standard types. Obtained from: OpenBSD
* Use __RCSID()wsanchez2000-07-091-6/+4
|
* Unduplicate IDs from comments, do $Id -> $FreeBSD$ (submitted-by: bde)hoek1999-09-111-2/+0
|
* $Id$ -> $FreeBSD$peter1999-08-281-2/+2
|
* Merge style- and trivial- only changes from OpenBSD (dated 1999/07/29-19:55+1).hoek1999-08-171-3/+8
| | | | Obtained from: OpenBSD, sometimes indirected from NetBSD; myself
* Revert $FreeBSD$ to $Id$peter1997-02-221-1/+1
|
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* O' to be bitten by CVS. Cleanup after importsteve1996-10-081-3/+4
| | | | | | of Christos' version of make(1) and add Id's. Set straight by: Bruce Evans and Peter Wemm :)
* Merge in NetBSD's changes to make(1). Changes include:steve1996-10-061-5/+4
| | | | | | | | | | | | | | | | - Add the .PHONY, .PARALLEL, and .WAIT directives - Added the -B and -m commandline flags - misc. man page cleanups - numerous job-related enhancements - removed unused header file (bit.h) - add util.c for functions not found in other envs. - and a few coordinated whitespace changes Special thanks to Christos Zoulas <christos@netbsd.org> for help in the merge. A 'diff -ur' between Net and FreeBSD now only contains sccsid-related diffs. :) Obtained from: NetBSD, christos@netbsd.org, and me
* NetBSD fixes: declare more prototypes, move .OPTIONAL in alphabetache1995-06-181-3/+6
| | | | | | | | order, prevent suffix rule, if direct or children dependances exists, forget to free v->name in var.c My fixes: fix famous ^\t\n bug, correct free order in str_end Reviewed by: bde Obtained from: NetBSD, me
* Remove trailing whitespace.rgrimes1995-05-301-11/+11
|
* Bring in a number of changes from NetBSD's make, fixing quite a fewjkh1995-01-231-20/+67
| | | | | | | | | | | | problems in the process: 1. Quoting should work properly now. In particular, Chet's reported bash make problem has gone away. 2. A lot of memory that just wasn't being free'd after use is now freed. This should cause make to take up a LOT less memory when dealing with archive targets. 3. Give proper credit to Adam de Boor in a number of files. Obtained from: NetBSD (and Adam de Boor)
* Fix a problem with passing quoted strings down to commands.sef1994-08-241-3/+6
| | | | Reviewed by: Sean Eric Fagan
* BSD 4.4 Lite Usr.bin Sourcesrgrimes1994-05-271-0/+439
OpenPOWER on IntegriCloud