History log of /freebsd-9.3-release/usr.bin/make/str.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 267654 19-Jun-2014 gjb

Copy stable/9 to releng/9.3 as part of the 9.3-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 225736 22-Sep-2011 kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by: re (implicit)


# 209951 12-Jul-2010 emaste

Remove extraneous ;


# 200417 11-Dec-2009 delphij

Remove unnecessary includes.

Reviewed by: rodrigc


# 163171 09-Oct-2006 ru

Don't go beyond the provided string when parsing the `\' character.

PR: bin/99985
Submitted by: Nate Eldredge
MFC after: 3 days


# 146543 23-May-2005 harti

Make the ArgArray_Init() function visible to the rest of make.
It will soon be needed for the .SHELL parsing code.


# 146345 18-May-2005 harti

Get rid of global variables for argument vectors produced by brk_string()
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


# 146147 12-May-2005 harti

The first element of the vector built by brk_string() is never
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)


# 144479 01-Apr-2005 harti

Style: fix indentation.


# 143253 07-Mar-2005 harti

Constify the input argument to brk_string.

Patch: 7.106

Submitted by: Max Okumoto <okumoto@ucsd.edu>


# 141437 07-Feb-2005 harti

Invent a Buf_AppendRange function that appends a non-NUL-terminated string
given by a pointer to the start of the string and a pointer one behind
the end.

Submitted by: Max Okumoto <okumoto@ucsd.edu>


# 141436 07-Feb-2005 harti

Invent a Buf_Append function to append a NUL-terminated string
and use it thoughout the code.

Submitted by: Max Okumoto <okumoto@ucsd.edu>


# 141269 04-Feb-2005 harti

Minor cleanup: make brk_string to return argc only if the pointer to it
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)


# 141133 02-Feb-2005 harti

Convert several typedefs from beeing pointers to structs to be the structs
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>


# 141104 01-Feb-2005 harti

Clean up include files and file including. Split nonints.h into pieces
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>


# 140870 26-Jan-2005 harti

Fix quoting of the MAKEFLAGS environment variable by only quoting spaces
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)


# 138972 17-Dec-2004 harti

Remove all the cleanup functions. There is no reason to free memory
just before exiting (especially given the number of memory leaks) -
it just costs time.


# 138548 08-Dec-2004 harti

Constify some calls of Buf_AddBytes.

Submitted by: Max Okumoto <okumoto@ucsd.edu>


# 138547 08-Dec-2004 harti

Consify the arguments to str_concat. Remove the STR_DOFREE flag for that
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>


# 138264 01-Dec-2004 harti

Style: remove a lot of unnecessary casts, add some and spell the null
pointer constant as NULL.

Checked by: diff -r on the object files before and after


# 138232 30-Nov-2004 harti

Stylification: missing spaces, extra space after function names, casts
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)


# 124966 25-Jan-2004 ru

Fixed a bug that previous revision has introduced -- we missed
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;
}
}
%%%


# 124840 22-Jan-2004 ru

Fixed broken logic when parsing double quotes.

PR: bin/61673
MFC after: 1 month


# 106106 28-Oct-2002 jmallett

Split var.c into var.c and var_modify.c and move all the modification funcs
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.


# 105826 23-Oct-2002 jmallett

Remove efree(), it isn't used consistently enough to even pretend that it
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.


# 104696 09-Oct-2002 jmallett

Convert make(1) to use ANSI style function declarations. Variable
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.


# 104108 28-Sep-2002 jmallett

Add empty default cases where they should be, remove non-local execution stuff
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


# 97123 22-May-2002 jmallett

str_concat() doesn't really take const arguments.

Submitted by: bde
Pointy hat to: jmallett


# 97104 22-May-2002 jmallett

Replace the evil that is __DECONST() with (void *). This is one of the least
evil things we can do involving the const qualifier and a pointer.

Submitted by: bde, ru


# 96071 05-May-2002 jmallett

Fix make(1) behaviour regarding SysV-style substitution when given a nil
left-hand-side.

PR: bin/5297
Submitted by: "Matthew Emmerton" <matt@gsicomp.on.ca>
MFC after: 1 week


# 94638 14-Apr-2002 obrien

Back out rev 1.17, it breaks dependencies.
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.


# 94607 13-Apr-2002 obrien

Revision 1.17 seems to break a subsequent buildworld (i.e. with the new
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


# 94587 13-Apr-2002 obrien

Update SCM ID method.


# 94585 13-Apr-2002 obrien

Make str_concat handle NULL arguments properly (a-la how ODE-2.3.6 make does).

Submitted by: jmallett
Inspired by: CMU BUILDTOOLS4 coredumping, ODE-2.3.6 make(1)


# 94584 13-Apr-2002 obrien

De'register.


# 94583 13-Apr-2002 obrien

Constify str_concat()

Submitted by: jmallett


# 69531 02-Dec-2000 will

There's also no point in #typedef'ing void/char pointers. Accordingly,
rip out ClientData/Address pointers and use standard types.

Obtained from: OpenBSD


# 62833 09-Jul-2000 wsanchez

Use __RCSID()


# 51150 11-Sep-1999 hoek

Unduplicate IDs from comments, do $Id -> $FreeBSD$ (submitted-by: bde)


# 50477 27-Aug-1999 peter

$Id$ -> $FreeBSD$


# 49938 16-Aug-1999 hoek

Merge style- and trivial- only changes from OpenBSD (dated 1999/07/29-19:55+1).

Obtained from: OpenBSD, sometimes indirected from NetBSD; myself


# 23006 22-Feb-1997 peter

Revert $FreeBSD$ to $Id$


# 21673 14-Jan-1997 jkh

Make the long-awaited change from $Id$ to $FreeBSD$

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.


# 18804 08-Oct-1996 steve

O' to be bitten by CVS. Cleanup after import
of Christos' version of make(1) and add Id's.

Set straight by: Bruce Evans and Peter Wemm :)


# 18730 06-Oct-1996 steve

Merge in NetBSD's changes to make(1). Changes include:

- 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


# 9254 18-Jun-1995 ache

NetBSD fixes: declare more prototypes, move .OPTIONAL in alphabet
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


# 8874 30-May-1995 rgrimes

Remove trailing whitespace.


# 5814 23-Jan-1995 jkh

Bring in a number of changes from NetBSD's make, fixing quite a few
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)


# 2266 24-Aug-1994 sef

Fix a problem with passing quoted strings down to commands.

Reviewed by: Sean Eric Fagan


# 1591 27-May-1994 rgrimes

This commit was generated by cvs2svn to compensate for changes in r1590,
which included commits to RCS files with non-trunk default branches.


# 1590 27-May-1994 rgrimes

BSD 4.4 Lite Usr.bin Sources