Commit Graph

7938 Commits

Author SHA1 Message Date
harti
36e83199cc Make sure machine is initialize before use. Also make two pointers const
to get rid of the last two const warnings.
2005-05-12 15:54:52 +00:00
harti
8a553d2355 Get rid of the warning about vfork() clobbering variables.
Submitted by:	Max Okumoto <okumoto@ucsd.edu> (7.246)
2005-05-12 15:54:17 +00:00
harti
585f572c6c Do mktemp() by hand to get rid of the mktemp() warning and the
possible associated security hole.

Submitted by:	Max Okumoto <okumoto@ucsd.edu> (7.245)
2005-05-12 15:45:14 +00:00
harti
1fa77b7e18 Use a variable initialized to a string instead of the string directly
to get rid of a const warning.

Submitted by:	Max Okumoto <okumoto@ucsd.edu> (7.244)
2005-05-12 15:41:02 +00:00
harti
8218c0d11c Move code in CondToken() and get rid of a goto.
Submitted by:	Max Okumoto <okumoto@ucsd.edu> (7.243)
2005-05-12 15:38:11 +00:00
harti
c5cd0cafaa Remove a useless else and un-indent the following code. 2005-05-12 15:35:33 +00:00
harti
de9fcf7a3a Revert the previous accidential commit. 2005-05-12 15:20:50 +00:00
harti
85aa055df3 Cleanup SuffFindArchDeps() to get rid of two const-warnings.
Submitted by:	Max Okumoto <okumoto@ucsd.edu> (7.240)
2005-05-12 15:20:03 +00:00
harti
0c5d8337ec 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)
2005-05-12 15:10:45 +00:00
harti
2df173ac68 Cleanup. Move initialisation of file and program global variables
to top of main() and sort them. Make chdir_verify_path() static - it
is used only here.

Submitted by:	Max Okumoto <okumoto@ucsd.edu> (7.238)
2005-05-12 15:04:14 +00:00
harti
8b9c642e87 Replace a lot of Var_Set(..., VAR_GLOBAL) by Var_SetGlobal().
Submitted by:	Max Okumoto <okumoto@ucsd.edu> (7.237)
2005-05-12 14:47:22 +00:00
harti
dfdc1e0f67 Cleanup main(). Move catching SIGCHLD into job.c. Move unsetenv("ENV")
into job.c. Move retrieving of environment nearer to the place where it
is actually used and invert the preprocessor conditionals to use
positive logic.

Submitted by:	Max Okumoto <okumoto@ucsd.edu> (7.236)
2005-05-12 14:43:32 +00:00
harti
00f50de80b Reshuffle functions to get rid of prototypes.
Submitted by:	Max Okumoto <okumoto@ucsd.edu> (7.235)
2005-05-12 14:35:01 +00:00
harti
ce844954ae Compat_RunCommand is used only in job.c so make it static there.
Submitted by:	Max Okumoto <okumoto@ucsd.edu> (7.234)
2005-05-12 14:33:24 +00:00
harti
8a832592ce Move variable printing from main.c to var.c
Submitted by:	Max Okumoto <okumoto@ucsd.edu> (7.233)
2005-05-12 14:31:42 +00:00
harti
e7ab78380c Fix the fix for bin/72510 applied in job.c:1.70. Actually there have
been two maxJobs variables: one static in job.c and one global used in
main.c and parse.c. Makeing one global out of these was the wrong way
to fix the problem. Instead rename the global one to jobLimit and keep
maxJobs static in job.c.

Suggested by:	rwatson
PR:		bin/72510
2005-05-12 14:16:44 +00:00
harti
ad17767376 Move some global variables to the correct files.
Submitted by:	Max Okumoto <okumoto@ucsd.edu> (7.232)
2005-05-12 11:58:39 +00:00
harti
d25fe44200 Untwist the convoluted if() expressions in JobFinish(). They
could benefit from even more untwisting.

Submitted by:	Max Okumoto <okumoto@ucsd.edu> (7.23[01])
2005-05-12 11:47:17 +00:00
harti
c8542dc6a9 Move some comments around to where they belong and remove some unneccessary
gcc magic.

Submitted by:	Max Okumoto <okumoto@ucsd.edu> (7.229)
2005-05-12 11:16:04 +00:00
harti
1abbaf545a Convert Compat_RunCommand() to use ProcWait(). This also gives Cmd_Exec()
the potential to handle interrupts which it doesn't currently.

Submitted by:	Max Okumoto <okumoto@ucsd.edu> (7.228)
2005-05-12 11:09:45 +00:00
harti
99e68afe6f Make a function ProcWait() that waits for the given process.
Submitted by:	Max Okumoto <okumoto@ucsd.edu> (7.227)
2005-05-12 10:55:37 +00:00
harti
64956650a5 Overhaul the fork(), exec() code. Put all the common handling that
takes place in the child process in a function ProcExec(). Make sure,
that the child does not call malloc() or other potential dangerous
functions (there are still calls to Punt() in the error case that
should go away). Allocate the argv string via malloc to overcome
the non-constness bug of the execvp prototype. Change the handling of
shell meta-characters and move the builtin list near the list of shell
builtins. Both of these lists should actuall be configurable by the .SHELL
target since they depend on the shell used.

Patch:		7.21[2-9], 7.22[0-46]
Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-05-12 10:40:57 +00:00
fjoe
80c76b58f6 - check for geom_uzip module presence using kldstat -m.
kldstat -m finds geom_uzip module even if it is compiled in statically.
- create output file with x bit set.
- build mkuzip on all architectures (verified with "make universe").
- fix typo in info message.
2005-05-11 17:02:38 +00:00
jmallett
1a7bb0831b Spell 1 as SHUT_WR in argument to shutdown(2). 2005-05-11 02:49:03 +00:00
harti
4e99d859a8 Move the definitions of the OP_* constants from make.h into GNode.h
where they actually belong to. Move the definitions of the strings
for special macros like "$*" from make.h to parse.h - they're used
only in the parser.

Submitted by:	Max Okumoto <okumoto@ucsd.edu> (7.211)
2005-05-10 14:27:04 +00:00
harti
a074124769 Path_Expand() expects its first argument to be writeable so put the
default system directory into a writeable character array before passing
it to Path_Expand().

Submitted by:	Max Okumoto <okumoto@ucsd.edu> (7.210)
2005-05-10 14:23:31 +00:00
harti
49e445d4c1 Move declarations of variables belonging to the variable module
from globals.h into var.h.

Submitted by:	Max Okumoto <okumoto@ucsd.edu> (7.209)
2005-05-10 14:16:40 +00:00
harti
312bbd99e5 Style: remove spaces before tabs.
Patch:	7.207
Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-05-10 14:13:20 +00:00
harti
2eb7ef8982 Move the remaining two prototypes from nonints.h to make.h and
remove nonints.h.

Patch:	7.204
Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-05-10 14:10:44 +00:00
harti
cb3c429895 Make shellPath and shellName static - they're used in job.c only.
Move definition of parsing error levels from make.h into parse.h.

Patches:	7.202,7.203
Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-05-10 14:06:19 +00:00
harti
3a6b30eead Make the three versions of fork() more uniform.
Patch:		7.201 (idea taken, but done differently)
Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-05-10 14:03:28 +00:00
harti
9b84402586 Move the defines for TMPPAT and KQUEUE from the public job.h into job.c
since they are used only there.

Patch:		7.200
Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-05-10 13:48:15 +00:00
harti
9f5daa0be5 Merge compat.c into job.c. There is a lot in common between these
files and we are going to factor this out.

Patch:		7.199 (slightly changed)
Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-05-10 13:45:29 +00:00
glebius
7db34cfe43 Add option -l, to make output line buffered.
PR:		bin/78692
Submitted by:	Eugene Grosbein
MFC after:	2 weeks
2005-05-10 13:40:50 +00:00
harti
a521f4fbfd Move Cmd_Exec() from main.c to job.c and fix its prototype. This
results in a warning that will go away soon.

Patch:		7.198
Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-05-10 13:18:58 +00:00
harti
e571f8f77c Var_SubstOnly() is only used to subsitute a variable from the global
context (and only in one place to substitute the .for variable). Therefor
there is no need to pass the context as a parameter.

Patch:	7.197
Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-05-10 12:02:15 +00:00
harti
aac19b11ef Move the declaration of VAR_CMD and VAR_GLOBAL from globals.h to var.h
Patch:		7.196
Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-05-10 11:58:52 +00:00
harti
5618be5938 Clean up comments. No code changes.
Patch:		7.195
Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-05-10 11:55:46 +00:00
harti
aa67517522 Merge var_modify.c into var.c and move types and function declarations
that are now used only in var.c from var.h to var.c

Patches:	7.193,7.194
Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-05-10 11:53:20 +00:00
harti
ede5ad1020 Move some debugging code from targ.c to var.c where it actually belongs.
Patch:		7.192
Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-05-10 08:14:26 +00:00
harti
35798a61f5 Make make a little bit more POSIXish with regard to option parsing:
take everything after -- as either a macro assignment or a target.
Note that make still reorders arguments before --: anything starting
with a dash is considered an option, anything which contains an equal
sign is considered a macro assignment and everything else a target.
This still is not POSIX with regard to the options, but it will probably
not change because it has been make's behaviour for ages.
Add a new function Var_Match() that correctly skips a macro call by just
doing the same as Var_Subst() but without producing output. This will help
making the parser more robust.

Patches:	7.190,7.191
Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-05-10 08:06:13 +00:00
harti
ef37b341c3 Split Var_Subst() into two functions: Var_SubstOnly() which substitutes
only one variable and Var_Subst() which substitutes all. Split out the
test whether a variable should not be expanded into match_var().
Make access to the input string consistently using str[]. Remove two
unused functions: Var_GetTail() and Var_GetHead().

Patches:	7.184-7.189
Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-05-09 14:06:04 +00:00
kientzle
5fd4825f3c Clarify some error messages. 2005-05-08 06:25:15 +00:00
harti
9e2faf2a2d Introduce a new pseudo-target .EXPORTVAR which allows to put a
make macro into the environment of programs executed by make. This
has approximately the same function as gmake's export directive.
The form of a pseudo target was deliberately choosen to minimize work
for POSIX compatibility (Makefiles are not allowed to use any targets
starting with a dot and consisting only of uppercase letters except those
specified in the standard when they want POSIX compatible behaviour, so
such a Makefile can never contain .EXPORTVAR.)
Change the handling of macros coming from the environment: instead
of asking the environment for each variable we could not find otherwise
put all the environment variables in a special variable environment just
at start up.

This has been tested on the ports cluster by kris.

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-05-06 18:30:06 +00:00
takawata
a61ec3d816 Make smbfs capable to use 16bit char set in filenames.
PR:78110
2005-05-04 15:05:46 +00:00
sobomax
6d0e34daa6 Enabke mkuzip(1) on amd64.
Submitted by:	Matteo Riondato <rionda@gufi.org>
2005-05-02 17:40:40 +00:00
sobomax
415d965096 Make WARNS=6 clean, which should make it compiling on amd64.
Submitted by:	Matteo Riondato <rionda@gufi.org>
2005-05-02 17:38:49 +00:00
green
8d250bc693 Make brandelf(1)'s -t "ABI format" case insensitive, as the ABI value
given is looked up in a table and no longer stored literally in the
header.

Submitted by: Divacky Roman <xdivac02@stud.fit.vutbr.cz
PR: 80499
MFC After: 1 month
2005-05-02 17:19:33 +00:00
delphij
729777db8a Include systat.h for cmdtab, to make gcc4 happy. 2005-05-02 10:50:10 +00:00
delphij
60c19065cd Consistently use signed char so gcc4 won't complain 2005-05-02 10:23:03 +00:00
harti
5b818d6be0 Rename the directive_hash.[ch] files to hash_tables.[ch] now
that there are more than one hash table in them. There is no
history to preserve here, so go without a repo-copy.

Asked for by:	Max Okumoto <okumoto@ucsd.edu>
2005-04-29 15:15:28 +00:00
harti
0dc78c5fd6 Implement a pseudo-target .WARN that allows toggeling the warning flags
for the current make. This does not override flags specified on the
command line and these settings are not passed to sub-makes.
2005-04-29 14:37:44 +00:00
robert
a07b9094ad Add flag to choose whether to use getgrouplist(3) or getgroups(2)
to the id_print() function.

Use getgrouplist(3) for the case when an user was specified,
and getgroups(2) when no user was given.
That reverts to the expected behaviour and makes it easy to
implement an option later to force using getgrouplist(3).
2005-04-29 10:11:18 +00:00
robert
1695f34782 Fix spelling error. 2005-04-29 08:37:52 +00:00
robert
38dd7daaf5 We need to pass NGROUPS + 1 to getgrouplist(3) to display
NGROUPS groups.  getgrouplist(3) may put a duplicate group
id into the passed array (it sets [0] and [1] to the value
of the gid argument), but id_print() sorts them out.
2005-04-28 16:11:37 +00:00
robert
56db316aaa - Merge two functions for printing `id' output.
Showing the ids of both an user given by an argument to `id',
   and the current user, is now handled in a single function.
   Displaying the current user's ids was inaccurate because
   getgroups(2) had been used.  getgroups(2) returns the current
   kernel state of a user's groups, which may not always be
   correct if /etc/group was recently changed.
 - Fix a few style bugs.

PR:		bin/78085
2005-04-28 15:55:54 +00:00
harti
5063114341 Introduce a flag to enable extended warnings (-x) and make them off
by default. This should fix the problem of getting lots of errors
when building with an up-to-date make and old *.mk files.
2005-04-28 15:37:25 +00:00
robert
848d150573 - Set negative row or column argument values to zero.
Negative values would produce undefined behaviour including
   a possible segmentation fault.
 - Explicitly initialize the global row and column variables
   to zero.

PR:		bin/80348
2005-04-28 12:37:15 +00:00
harti
cb2545c652 Use a minimal perfect hash for the special sources/targets too. Add
the corresponding magic to create the hash function to the Makefile.
2005-04-28 12:05:43 +00:00
harti
b38862d9b3 Fix the $$FreeBSD$$ that should be written verbatim to directive_hash.c
so that it doesn't get replaced with the Makefile's revision.
2005-04-28 08:04:46 +00:00
harti
6b86becddd Move the hash function for directives into its own file and add
a Makefile target to re-created this file. Note, that there is no
explicite dependency to automatically re-create the file, because this
is needed only when the directive table changes and it requires the
(yet to come) devel/mph port.

Submitted by:	Max Okumoto <okumoto@ucsd.edu> (first version)
2005-04-28 07:55:55 +00:00
kientzle
839391fc8e bsdtar now uses the "tree" package instead of "fts" for walking
directory heirarchies.
2005-04-24 05:53:37 +00:00
kientzle
d4451ef08b Correct autoconf/automake invocation to work with devel/gnu-auto* from
ports.

Thanks to: Dag-Erling Sm?rgrav (des@)
2005-04-23 18:44:25 +00:00
kientzle
c4cef244d6 Minor fix to the configure logic to properly detect ACL support. 2005-04-23 18:41:28 +00:00
kientzle
2fe0aef3f1 Overhaul getdate.y. In particular, remove minutes-based logic
(combine with existing seconds-based), treat '-' as punctuation rather
than a negative number indicator (eliminates several special cases),
use a single list of special words instead of several separate lists,
use table-driven abbreviation logic (eliminate duplicate word entries
and special-case abbreviation and plural handling).  The result is
shorter, simpler (judging from comments, earlier maintainers didn't
understand the special handling for "negative years"), handles more
cases (e.g., "tu" is now a recognized abbreviation for "tuesday",
"3rd" is now equivalent to "third") and it has 2 fewer shift/reduce
conflicts.
2005-04-23 18:38:32 +00:00
murray
9097797b6a Point users to tcsh(1) for information about shell globbing patterns,
rather than 'XXXX'.

MFC after:	1 week
2005-04-19 16:06:04 +00:00
cperciva
757f59e8d6 MFS revision 1.139.2.4 (add edwin) because I accidentally committed to
RELENG_5 instead of HEAD.

Pointy hat to:	The large pile of hats over in the corner.
2005-04-18 01:36:17 +00:00
kientzle
6857f1e3f7 A very minor tweak to the handling of leading '/' characters. 2005-04-17 19:46:50 +00:00
kientzle
f666e865e6 A number of fixes to the autoconf-generated build system. In
particular, acl support is no longer enabled on FreeBSD 4, acl support
should be correctly enabled on Linux, dirent.d_namlen should be
correctly detected on platforms that support it.

Thanks to: Greg Lewis, Juergen Lock, and Jaakko Heinonen
2005-04-17 19:43:37 +00:00
kientzle
b27e034c99 Configure script needs to test for dirent.d_namlen.
Thanks to: Juergen Lock
2005-04-17 17:53:24 +00:00
kientzle
877f4c482e Update "make distfile" to use newest automake/autoconf from ports.
Thanks to: Juergen Lock
2005-04-17 17:51:05 +00:00
kientzle
ec0a4e2bdb Support path-rewriting options (including --strip-components) for both
extraction and creation.  While I'm here, fix a bug reported by Garrett
Wollman: when stripping the leading '/' from the path "/", don't produce
an entry with an empty name; produce "." instead.
2005-04-17 17:20:54 +00:00
keramida
7c969cff25 Reduce the width of the THR column to 4 characters, to avoid wrap-around
of lines in SMP machines (which are wider), until we have a better way
of handling window sizes & columns in top.

Caught by:	ache, Andre Guibert de Bruet <andy@siliconlandmark.com>
Point hat:	keramida
2005-04-16 15:43:38 +00:00
stefanf
15966b5041 Update the bugs section, null characters in the format string are now handled. 2005-04-14 18:29:59 +00:00
stefanf
2fed363379 Handle null characters in the format string. A \0 in the argument passed to %b
still results in trucation but this is be much harder to fix.
2005-04-14 17:02:34 +00:00
stefanf
0a2e28c772 No reason to write \a and \v as octal escape sequences. 2005-04-14 15:32:21 +00:00
keramida
eae5910982 - Add a THR column to the process listing, that shows the number of
threads a process has.  The THR column is disabled and disappears
  when 'H' is hit, because then every thread gets its own output line.
- Allow sorting processes by "threads".

Approved by:	davidxu
Inspired by:	Jiawei Ye <leafy7382@gmail.com>
2005-04-14 15:02:03 +00:00
stefanf
ff75aa6dbd Printf(1) is WARNS 6 clean. 2005-04-14 08:43:36 +00:00
stefanf
0d769accf3 - Move parts of the long main() function into a new function doformat().
- Rewrite the loop in main() to be more understandable.
2005-04-14 08:40:28 +00:00
stefanf
fd79e6a683 Assign 0.0 to the variable passed to getfloating() if the argument is missing.
MFC after:	1 week
2005-04-13 19:54:03 +00:00
harti
347920afa9 Split VarFind() into a series of functions tailored for the different sets
of flags originally passed to VarFind(). This eliminates the code by
removing a bunch of tests.

Patch:		7.173

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-04-13 11:40:44 +00:00
mdodd
44f26591d0 Add support for more than two datasets. Currently limited to 7 though
the limit is only the number of meaningful graph symbols available.

Statistical comparison is performed between the first dataset and
any further datasets.

No objection by:	 phk
2005-04-13 05:50:56 +00:00
jylefort
73f010cd0d Add myself as a new ports committer.
Approved by:	adamw (mentor)
2005-04-12 20:06:43 +00:00
ru
07d3bbca19 Silence a warning on systems without carp(4). 2005-04-12 08:47:04 +00:00
stefanf
aed8bcfc2b Replace buggy for-loops to skip certain character with strspn(). If *fmt was
'\0' (eg in the invocation 'printf %'), the for-loop would miss the terminating
null character.

MFC after:	1 week
2005-04-11 10:57:54 +00:00
harti
3fcd99fa67 Parse_Init() is gone so remove comments that mention it. 2005-04-11 07:40:54 +00:00
harti
6a44af4932 Remove an unneccesary forward declaration for MainParseArgs().
getopt() may be called several times - make sure to set optreset
to reset it. Cleanup handling of non-option arguments.
Remove some misleading comments.

Patch:		7.171

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-04-11 07:32:49 +00:00
harti
31837fbbe6 Remove the call to Parse_Init() - there is no need to initialize
a static variable to NULL. Forgot this in the previous commit to
parse.[ch].
2005-04-11 07:26:21 +00:00
harti
e0e1cda47d Rework the directive parsing code. Instead of using a lot of strcmp()s
on every line that starts with a dot use a minimal perfect hash
function and a single strcmp() on the first word after the dot
to find out whether it is really a directive call and, if yes, which
one. Then directly dispatch to a handler function for that directive
(or fall through to the dependency handling code). This makes the
directive parse a little bit more strict about the syntax: the directive
word must be followed by a character that is not alphanumerical and not
an underline (making .undefFOO illegal); .endif and .else can only be
followed by comments.
2005-04-11 07:20:10 +00:00
remko
c52e79424b Add myself to the calendar.
MFC after: 	1 week
Approved by:	simon (mentor)
2005-04-10 19:03:48 +00:00
stefanf
60b910d7c2 Remove unused variables. 2005-04-09 14:31:41 +00:00
murray
b54f449e43 Commodore Perry was not 4 years old when he sailed to Japan. Correct
birth year.
2005-04-08 09:50:30 +00:00
joel
231b2a9d26 Add myself (and decrease the average age).
Approved by:	brueffer (mentor)
2005-04-08 09:04:29 +00:00
harti
ad1daccf07 Move the code for parsing .for and .if statements to the place where the
other directives are handled.
2005-04-08 09:03:40 +00:00
harti
da722414da When Parse_Error is called after the top-level Makefile is closed we
have no CURFILE anymore so we cannot print a file name or line number.

When ParseSkipLine() returns NULL (it does this when it has detected an
EOF in an .if block) try to pop the input stack and process the next line
2005-04-07 14:39:38 +00:00
harti
75b2f0b4cc Handle popping of the input stack in ParseReadLine() instead of
Parse_File(). Remove a comment and a piece of code comming from
ancient times when the if-directive read like #if and not .if.
Correctly analyze the first character of a line.
2005-04-07 11:29:39 +00:00
harti
ba01ab9700 Mostly stylistic changes: remove the noPLen field from the Shell
structure - it is just the strlen() of noPrint. Inline JobCondPassSig()
in the only function JobPassSig() using it. Fix the argument types
of JobPrintCommand(). Better parsing for the .SHELL target keywords.
2005-04-07 11:26:15 +00:00
harti
e8348c9f03 There is not much sense in having an else after Punt() and _exit() which
never return. Also use pid_t for variables holding PIDs.
2005-04-05 12:33:54 +00:00
harti
f3be953c78 Put parantheses into 'if (foo && bar & flag)'. While they are not strictly
needed, they are useful for the human reader.
2005-04-05 08:14:40 +00:00
harti
980b8c2099 Remove lots if irritating parantheses and fix two comments.
Checked by:	md5
2005-04-05 08:09:48 +00:00
harti
d697c96c94 Remove the definition for STATIC and just use static. 2005-04-05 07:44:11 +00:00
harti
7786d65f29 Remove unneccessary local prototypes. 2005-04-05 07:43:02 +00:00
harti
a868b14c9b The static tfile is used only in one single function so move it into that
function.
2005-04-05 07:40:40 +00:00
harti
21d8737201 The tfile field of struct Job isn't used anymore since revision 1.22 so
remove it now.
2005-04-05 07:32:12 +00:00
stefanf
7d745ab866 Include <string.h> and <strings.h> for various functions. 2005-04-04 21:19:48 +00:00
pjd
650f7fc58c If they ever tell my story,
let them say I lived in the time of Pope John Paul II,
one of the greatest man...

Je¶li kiedy¶ kto¶ opowie moj± historiê,
niech powie, ¿e ¿y³em w czasach Papie¿a Jana Paw³a II,
jednego z najwspanialszych ludzi, najwspanialszego Polaka...

			-- Pawe³ Jakub Dawidek, atheist
2005-04-03 09:46:06 +00:00
imp
ce6b3c821b Don't refer to devices that don't exist. 2005-04-03 05:19:45 +00:00
tanimura
21cf84ad60 Commemorate the bicentenary of Hans Christian Andersen's birth by
adding his birthday.
2005-04-02 09:27:13 +00:00
tjr
3a8b8f05cd Use rpmatch() instead of checking for responses that begin with 'y'
in queryuser(). This allows users to respond to -ok and -okdir
prompts with any affirmative reply defined by their current locale.
2005-04-02 07:44:12 +00:00
harti
a366657808 Use a type-safe intrusive list to put jobs on the jobs or stoppedJobs list
instead of the generic Lst.
2005-04-01 16:24:25 +00:00
harti
b2e188d271 Remove a forward declaration that isn't needed anymore. 2005-04-01 16:23:48 +00:00
harti
992d45983f Both struct Job and struct Shell are only used inside job.c so there is
no need to have them in a header file that is included by other modules.
Move them both into the c-file.
2005-04-01 13:35:35 +00:00
harti
69c4bf767a Style: fix indentation. 2005-04-01 13:25:45 +00:00
harti
d6f9d698c0 Style: fix indentation. 2005-04-01 13:06:05 +00:00
harti
ae0fcd1f54 Style: indentation. 2005-04-01 13:02:17 +00:00
harti
5eacd6ebd8 Style: Indentation. 2005-04-01 12:42:03 +00:00
harti
52707a6f25 Style: fix indentation. 2005-04-01 12:31:15 +00:00
harti
b4343e6f86 Style: fix indentation. 2005-04-01 11:20:17 +00:00
harti
0f7b53389d Style: fix indentation. 2005-04-01 11:12:29 +00:00
harti
3cb4e5dca4 Style: fix indentation. 2005-04-01 10:53:43 +00:00
cperciva
ccca7719c7 Note the passing of Cameron Grant <cg@FreeBSD.org>.
Approved by:	quiet1
2005-03-31 23:15:14 +00:00
harti
bf21be6c02 Document the new -A flag for ignoring archive errors. 2005-03-31 11:40:53 +00:00
harti
800d083cdf Almost complete rewrite of the archive code (except for the Makefile parsing
part). Archive handling was broken at least since the move from BSD ar/ranlib
to GNU binutils because of the different archive format. This rewrite fixes
this by making make to carry around the defines for all formats (it supports)
so it can support all of them independent of the actually used one. The
supported formats are: traditional BSD (this seems to come from V7 at least,
short names only and __.SYMDEF), BSD4.4 (long names with #1/ and __.SYMDEF)
and SysV (extra name table and //). The only format not supported are broken
traditional archives where the member names are truncated to 15 characters.

Errors in the archive are not ignored anymore, but cause make to stop with
an error message. The command line option -A causes these errors to become
non-fatal. This is almost compatible with previous usage except for the
error message printed in any case.

Use a type-safe intrusive list for the archive cache.

Reviewed by:	Max Okumoto <okumoto@ucsd.edu> (without new error handling)
2005-03-31 11:35:56 +00:00
harti
bdea8226c7 Move the MAX macro to a util.h so it becomes usable in other modules.
Suggested by:	Max Okumoto <okumoto@ucsd.edu>
2005-03-31 11:12:45 +00:00
harti
495f1f48a8 Make the structure for handling the input stack local to the parse
module. The only module accessing it (the current line number) was the
condition module, so pass the current line number as a function argument.
Centralize the pushing of new input sources into one function
ParsePushInput() and rename the function handling the popping from ParseEOF()
to ParsePopInput(). Make the entire thing a little bit clearer, by holding
the current input source in the top element of the stack instead of
using extra variables for this. Use a type-safe intrusive list for the
input stack.
2005-03-30 15:18:58 +00:00
harti
cf97e03db7 Fix a bug introduced in a previous commit: ParseModifier() consumes
characters so it is not safe to move around code from
before it to after it. This should fix problems with building the
documentation.

Patch:		7.170

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-03-30 15:14:22 +00:00
obrien
f37742ff89 Add directory hierarchy copying example. 2005-03-28 18:18:44 +00:00
obrien
7ba10bc7d4 Note when 'stat' appeared in FreeBSD. 2005-03-28 04:02:45 +00:00
alfred
12a374aa60 When doing the initial open of the proc via procfs, complain if we are
unable to open the /proc/pid/mem file.  Otherwise doing a truss on
a nonexistant pid makes us return success even though no such process
exists.
2005-03-27 12:53:25 +00:00
alfred
9e2b623bb5 I've been working on this somewhat so I'm moving the
parts I'm touching to be as style(9) compliant as I can.
2005-03-27 12:47:04 +00:00
harti
b6830526cf Style: de-lispify by removing extra parantheses in conditional expressions. 2005-03-23 16:28:57 +00:00
harti
f40119114e Style: make indentation 8 characters. 2005-03-23 16:14:41 +00:00
harti
4fa1581ab5 Make paths an explicite datatype instead of using the generic Lst.
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.
2005-03-23 12:56:15 +00:00
harti
d8c301673b Style: <space><tab> -> <tab> 2005-03-22 12:59:02 +00:00
harti
bdf00a2e37 Rename struct Path to struct Dir and move it into the C-file. It
is not used outside.
2005-03-22 12:54:46 +00:00
harti
3af42ed6ab Remove debugging code that crept in in the last commit. 2005-03-22 12:52:00 +00:00
harti
d00a9bb878 Remove Lst_Find() and Lst_FindFrom() now that they aren't needed anymore. 2005-03-22 12:40:24 +00:00
harti
08bf05ebc0 Remove the last two instances of Lst_Find() calls. 2005-03-22 12:38:55 +00:00
harti
9e39ec1de2 Use VarParse() inside var.c instead of Var_Parse().
Patch:		7.163

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-03-22 08:20:08 +00:00
harti
d904cc8dd6 Unify callers to Var_Parse() with regard to variable names.
Patch:		7.162

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-03-22 08:18:15 +00:00
harti
b2bb207f6b Make some callers of VarFind using the same code structure.
Patch:		7.161

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-03-22 08:16:09 +00:00
harti
f4c9341562 De-lispify some if()-expressions by removing extra parantheses.
Patch:		7.160
Requested by:	harti

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-03-22 08:12:16 +00:00
harti
3c9bfe335d Return a Buf object from VarGetPattern() instead of a char * and a size_t.
Store a Buf object in struct VarPattern instead of a char * and a length.

Patch:		7.158

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-03-22 08:09:43 +00:00
harti
9c7887893b Use the struct VarPattern's lhs field instead of using an extra variable
to store the left expression of a C modificator.

Patch:		7.157

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-03-22 08:06:34 +00:00
harti
6218a3c3c1 Merge struct VarREPattern into struct VarPattern. This will help sorting
out common code.

Patch:		7.156

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-03-22 08:03:42 +00:00
harti
5865566c6d Sort prototypes.
Patch:		7.155

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-03-22 08:01:04 +00:00
harti
22e9de609b Fix indentation.
Patch:		7.154 (partly)

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-03-22 08:00:02 +00:00
harti
9438de8315 Delete an extra empty line.
Patch:		7.153

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-03-22 07:57:18 +00:00
harti
2cb520d06e An automatic variable in a local scope is (conceptionally) destroyed with
the closing brace so it is unwise to keep a pointer to it. Make
the variable static to fix this.

Patch:		7.152

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-03-22 07:56:22 +00:00
harti
874c97e5d4 Simplify buffer access by using Buf_Data() and Buf_Peel() where
appropriate.

Patch:		7.147-7.151

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-03-22 07:50:40 +00:00
harti
5ced7169a6 Two new functions: Buf_Data() returns a reference to the data in
the buffer and Buf_AppendBuf() appends a copy of one buffer to another
buffer.

Patch:		7.146,7.147

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-03-22 07:42:51 +00:00
harti
0db579ed3a Remove a temporary variable. Rename pattern to patt to be consistent.
Remove unreachable code for VAR_NOSUBST - it was never set.
Replace redundant code with calls to VarGetPattern().

Patch:		7.143-7.145

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-03-22 07:38:46 +00:00
harti
e023a7de70 Remove unneeded temporary variables in modifier_S() and modifier_C().
Change the parsing of the C modifier flags so that specifying both
'1' and 'g' gives an error.

Patch:		7.141,7.142

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-03-21 12:40:27 +00:00
harti
347aea443e Remove comment about Var_Parse assuming that the first character
is always a '$'. This is not always correct, for example for
conditionals: .if defined(foobar).

Clean up some comments.

Move common code out of if-statements.

Patch:		7.140

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-03-21 12:32:41 +00:00
harti
86fccdb68e Split out SysV variable substitution into its own function.
Patch:		7.139

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-03-21 12:27:53 +00:00
harti
ae5d59a29a Rename freePtr to freeResult to make it more obvious about what
pointer we're talking.

Patch:		7.138

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-03-21 12:19:23 +00:00
harti
79f8c5593b Move some code from ParseModifier() into the calling function to
simplify things. Correct a number comments.

Patch:		7.137

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-03-21 12:17:44 +00:00
harti
fcbb234244 Cleanup the VAR_JUNK handling.
Patch:		7.136

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-03-21 12:15:06 +00:00
harti
17ff92e4b8 Don't pass 'consumed' through all the parsing routines where it can be computed
by the caller. Don't pass 'endc' - it can be computed from 'startc'.
Remove unneccessary temporary variables. Remove constant if-expressions
and remove code before call Fatal() - there is no point to cleanup before
aborting.

Patch:		7.134,7.135

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-03-21 12:07:14 +00:00
harti
f3ce1067ac Change one occurence of 'delim' to the correct type. Delete another
occurence which actually holds always the same constant value.
Shorten the name pattern to patt.

Patch:		7.133

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-03-21 11:54:46 +00:00
harti
cc6fd34f2d Replace calls to Lst_Find with either appropriate LST_FOREACH macros
plus predicate inlining or a special purpose function with takes
and returns the correct types.
2005-03-21 11:44:57 +00:00
harti
59177829ff Reduce number of parameters passed between the parsing routines
by putting them into struct VarParser or computing them (consumed).
Change the loop termination condition in VarParseLong from endc to \0.

Patch:		7.128-7.132

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-03-21 11:43:02 +00:00
das
f5e55fd604 Support the L modifier for floating-point values as an extension.
When L is omitted, double precision is used, so printf(1) gives
reproducable results.  When L is specified, long double precision is
used, which may improve precision, depending on the machine.
2005-03-21 08:01:09 +00:00
harti
47633d30dc Reduce the number of explicit parameters passed to VarParse()
by passing them through struct VarParser.

Patch:		7.127

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-03-21 07:40:33 +00:00
iedowse
316bdea082 Don't skip the initialisation of tl->len when we hit an EOF immediately
after allocating a new buffer. This bug caused `tail -r < /dev/null'
to core dump when the `J' malloc option is set, and also affected
any other input that was an exact multiple of 128k.
2005-03-20 22:08:52 +00:00
kientzle
c74d7d94bd Deorbit gtar, step 1: Remove WITH_GTAR knob.
"tar" is now always a synonym for "bsdtar".
  People who need gtar can access it as "gtar."

Approved by:	No objections on arch@
2005-03-20 20:38:46 +00:00
pjd
1fbe41652e Whitespace fixes. 2005-03-20 11:47:44 +00:00
pjd
c7d05e490c - Introduce an '-o' option which allows to match oldest of the matching
processes.
  This option can be also found in Solaris and Linux.
- Use timercmp(9) macro for timeval comparsion.
- Include time.h directly, don't depend on stat.h doing it for us.

Reviewed by:	gad (first point)
MFC after:	3 days
2005-03-20 11:42:26 +00:00
pjd
a5414c9dd1 - Introduce '-S' option which allows to match system processes (pgrep only).
- Rename IS_KERNPROC() macro to PSKIP() and extend its functionality.
  Now it'll skip calling process and system processes when -S is not given.
  As a side effect it fixes '-n' option. Before it was always matching
  calling process (because of missing 'if (kp->ki_pid == mypid)' check)
  and after that, calling process was ignored.
- When '-l' option is given and there are no arguments, use p_comm as an
  arguments list (this is helpful for kernel threads matching).

Reviewed by:	gad
MFC after:	3 days
2005-03-20 11:30:26 +00:00
pjd
b616d49d9f Sort options properly.
Reviewed by:	gad
MFC after:	3 days
2005-03-20 11:17:06 +00:00
pjd
d88f375460 Add a -i option to ignore case in the process match.
Obtained from:	NetBSD
Reviewed by:	gad
MFC after:	3 days
2005-03-20 11:12:13 +00:00
pjd
3f98083e57 Add and document '-F' option which allows to use file where PID is stored
for matching.

Reviewed by:	gad
MFC after:	3 days
2005-03-20 11:03:11 +00:00
pjd
2b2f4d5e6e Add and document '-j' option which allows to match processes based on its
jail ID.

Reviewed by:	gad
MFC after:	3 days
2005-03-20 10:53:54 +00:00
harti
5b55d8aa02 Cleanup handling of colons in variable substitutions.
Patch:		7.126

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-03-18 16:52:46 +00:00
harti
4565898f62 Unfold parsing of single letter modifiers from multi-letter ones.
Patch:		7.125

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-03-18 15:51:04 +00:00
harti
821eec0009 Style: fix indentation and <space><tab>.
Patch:		7.124

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-03-18 15:44:23 +00:00
harti
efa8f52f88 Split out the 'S' modifier into its own function.
Patch:		7.122,7.123

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-03-18 15:37:31 +00:00
harti
f00fcf68ef Convert Var_Parse to a wrapper function.
Reduce the number of arguments passed between these functions by
creating a special-purpose struct.

Patch:		7.120,7.121

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-03-18 15:34:07 +00:00
harti
5b2a5b84de Replace Lst_Find calls with LST_FOREACH loops. This helps in
constification und simplifies the code because the one-liner
predicates can be inlined into the code.
2005-03-18 15:25:23 +00:00
harti
3cd2d2d0d5 Replace a bogus use of Lst_Find with explicite LST_FOREACH calls
and remove the unneeded second argument to ReadMakefile.
2005-03-18 15:23:49 +00:00
harti
3754e8fb58 Fix a bug in matching suffixes. Under certain circumstances the code
would access memory before the beginning of the string to match (the
suffix match starts at the end of both the string and the suffix and
proceedes to the begin until either the start of the suffix is hit
or the character does not match). This could lead to a memcpy copying
into random memory. Fix this by checking the length of the string to
match too and replacing the Lst_Find calls with LST_FOREACH loops
(last part by me).

Submitted by:	Matt Dillon <dillon@apollo.backplane.com> (in principle)
2005-03-18 15:16:09 +00:00
harti
3d5967d365 Now that there are no users of Lst_ForEach and Lst_ForEachFrom are left
delete these two macros and all the associated stuff.
2005-03-16 16:11:11 +00:00
harti
df4f9cb09a Replace Lst_ForEach by LST_FOREACH. 2005-03-16 16:02:09 +00:00
harti
cbbd172aea Replace another bunch of Lst_ForEachs by LST_FOREACHs and simplify code. 2005-03-16 12:22:15 +00:00
phk
3ff5706695 Dike out another kvm indiscretion. 2005-03-16 10:24:16 +00:00
harti
35b09a0244 Fix a comment. 2005-03-16 08:06:28 +00:00
harti
fe00d22104 Get rid of another bunch of Lst_ForEach in favour of LST_FOREACH and
simplify code accordingly.
2005-03-16 08:04:45 +00:00
harti
0ce269a189 Ups. Revert the last commits. These have been committed by accident. 2005-03-15 15:10:51 +00:00
harti
6fc3b6df1c modifier_M: instead of going through the string twice to compute the
size of the buffer we need, just allocate the possible maximum.

Patch:		7.117

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-03-15 15:05:14 +00:00
harti
7bd6f53de6 Style: Move a variable from a local scope up to the begin of the function.
Rename result variable so common code becomes more visible.
Rename freePtr to freeResult to make clear what pointer must be freed.

Patch:		7.116, 7.116a

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-03-15 14:52:10 +00:00
phk
2116975c84 Dike out unwarranted si_udev fondling. 2005-03-15 14:30:26 +00:00
harti
384241be9f Get rid of a number of Lst_ForEach calls in favour of LST_FOREACH
and simplify the printing functions.
2005-03-15 14:28:39 +00:00
harti
84812666f6 VarParseLong: move the detection of the modifier separator ':' into
the loop. Add a comment why the 'consumed' variable is updated.
Rename lengthPtr to consumed.

Patch:		7.115

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-03-15 14:27:29 +00:00
harti
db06c5de06 Yet another version of passing the last line to ParseFinishLine().
It turns out that some ports use the obscure feature of spreading
a dependency block across multiple include files. While this seems
bad style, allow it for now and call said function only at end of
all input to process the really last line of everything.
2005-03-15 14:25:24 +00:00
harti
6427cb7c26 Get rid of another Lst_ForEach in favour of LST_FOREACH. Get rid
of the now unused struct LstSrc and collapes two functions into one.
2005-03-14 17:04:58 +00:00
harti
e46b6260f7 ParseModifier(): rename rw_str to value and reindent cleanup section.
ParseRestModifier() and ParseRestEnd(): move advancement of ptr to remove
a confusing calculation.
VarParseLong(): cleanup calculation of consumed.

Patch:		7.114

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-03-14 17:03:34 +00:00
harti
6c1fea3e9f Move the creation of a Src structure into its own function. 2005-03-14 12:04:20 +00:00
harti
65a16da8cc Split off two function from VarParseLong to handle modifiers and the
actual variable lookup. Consistently rename lengthPtr to consumed.
Update a number of comments to match the code.

Patch:		7.111-113

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-03-14 12:03:30 +00:00
harti
dffc7fe63f Convert a couple of other uses of Lst_ForEach to LST_FOREACH and
simplify code.
2005-03-14 08:29:58 +00:00
kientzle
7f4dba0f0e A handful of minor portability and style improvements. 2005-03-14 00:30:35 +00:00
kientzle
c46a8c03ea Style correction: one tab after #define. 2005-03-14 00:29:05 +00:00
kientzle
b3cbed0960 Re-unbreak the distfile target.
Also, reduce the WARNS level to 5 since different build environments
end up using different Yacc skeletons.  The BSD one does not
predeclare yyparse, the FSF one does, so it's not really possible to
consistently enforce both -Wmissing-prototypes and -Wredundant-decls.
2005-03-13 23:49:53 +00:00
kientzle
2b38f44c2f Fix a compile warning, fix the build. 2005-03-13 21:36:15 +00:00
kientzle
4949e1d1ad "make depend" with .y files is trickier than it looks. <sigh> 2005-03-13 19:55:53 +00:00
kientzle
5d0c5f694a Brain-o. Missing quote. 2005-03-13 19:44:19 +00:00
kientzle
832a345376 Add --newer-ctime, --newer-mtime, --newer-ctime-than, and --newer-mtime-than
switches to support selecting files by time of modification.

Special thanks to: Steven M. Bellovin, Rich $alz, and Jim Berets,
	authors of the public-domain getdate.y date-parsing code.
2005-03-13 18:36:24 +00:00
ceri
14adec0b92 Remove an unused #define. md5's with and without this commit match.
Approved by:	murray (mentor)
2005-03-13 17:58:31 +00:00
kientzle
0eac7627b8 Add --strip-components option, per bin/77666.
Thanks to: Sangwoo Shim
2005-03-13 04:12:30 +00:00
stefanf
8655a91f58 Use socklen_t where appropriate. 2005-03-11 14:17:12 +00:00
harti
559d1826e4 Simplify the print routines by using LST_FOREACH instead of Lst_ForEach
and inlining the small printing utility functions.
Create a function that can be used to produce printable representations
of flag words.
2005-03-11 13:24:08 +00:00
harti
d72309cdad Remove leading underscores from the pathname defines. All identifiers
with leading underscore followed by an uppercase letter are in the
implementation namespace.
2005-03-11 13:02:38 +00:00
harti
dc263e28e9 Remove the leading underscore from structure tags. All identifiers
with a leading underscore are in the implementation namespace.
2005-03-11 12:57:25 +00:00
harti
503e7ada08 Style: Fix indentation. 2005-03-11 12:40:55 +00:00
harti
364f261bed Call ParseFinishLine() also for the last line in a file. This
patch differs from the previous one in that it calls the function
only when a real file hits EOF. The bodies of .for loops are also
handled as files, but for these we don't want to end a dependency block
on the 'EOF' as in:

foo:
	do-this
.for ...
	do-something
.endfor
	do-more
2005-03-11 11:29:39 +00:00
harti
6d878c5dc2 Back out the last commit. It turns out that this breaks more than
it fixes. This should fix the buildworld breakage.
2005-03-11 07:53:32 +00:00
harti
751b56b164 Constify Var_Dump and simplify it by inlining VarPrintVar. 2005-03-10 15:38:01 +00:00
harti
e98f139ac2 Call ParseFinishLine() for the last line of a file too. 2005-03-10 15:30:09 +00:00
harti
188f70d7e9 Reorganize Suff_EndTransform to be called only for nodes for
which it is needed (transforms).
2005-03-10 14:54:47 +00:00
harti
32e1481603 Style: fix function style before working on it (mainly intendation). 2005-03-10 10:16:03 +00:00
ps
f01ea9b626 Add limits on the number of elements in the sack scoreboard both
per-connection and globally. This eliminates potential DoS attacks
where SACK scoreboard elements tie up too much memory.

Submitted by:	Raja Mukerji (raja at moselle dot com).
Reviewed by:	Mohan Srinivasan (mohans at yahoo-inc dot com).
2005-03-09 23:14:10 +00:00
novel
eb6ca0c62a Add myself.
Approved by:	krion (mentor)
2005-03-09 17:41:42 +00:00
harti
ba42fcc409 Implement a new macro LST_NEXT which is like Lst_Succ but doesn't check
for its argument to be non-NULL.
2005-03-09 16:53:31 +00:00
harti
bb218a7c02 Split SuffExpandChildren into three functions: one that skips
variables and expands archive specifications, one that expands
wild cards and a driver that loops over the children list and
expands each child if necessary replacing it with it's expansions.
2005-03-09 16:51:43 +00:00
stefanf
b4856acd04 Fix dubious C code construct. 2005-03-09 11:57:32 +00:00
harti
633c8c538c Var_Subst() cannot return NULL so there is no reason to check
for it.
2005-03-09 07:53:03 +00:00
harti
1dd03a69ac Style: fix indentation of SuffExpandChildren before working on it. 2005-03-08 16:30:32 +00:00
harti
af76c1e1e3 Use Buf_Peel to get rid of a local variable. 2005-03-08 14:37:47 +00:00
harti
71a2608310 Use the Buf_Peel function to get to the string contained into a
buffer without using an extra local variable.
2005-03-08 14:33:58 +00:00
harti
645fdd0f11 Remove useless local prototypes. 2005-03-08 14:30:18 +00:00
harti
aec2338af9 Style: fix indentation. 2005-03-08 14:29:23 +00:00
harti
3d0845b481 Use the new Buf_Peel function to simplify things.
Remove an unused struct definition.
2005-03-08 13:15:51 +00:00
harti
d8085e2228 Create a new function Buf_Peel that returns the string from inside
a Buffer and frees the Buffer.
2005-03-08 13:15:18 +00:00
keramida
891dde82bd Use 12 columns for (int) values, 20 columns for (long) and align
headers properly (right justified for numbers, left justified for
everything else).

This fixes the alignment of the fields on i386, sparc64 and amd64
today but does not dynamically assign column widths or bear in mind
that some of the values may be 64-bit in the future.

Reviewed by:	alfred
2005-03-08 13:14:46 +00:00
fanf
dc5d130c24 Sync with upstream:
Allow the user to run unifdef without defining any symbols. This is
useful in conjunction with the -k flag.
Fix a bug in the -s handling code that would have caused out-of-bounds
array accesses.
Add a -n option to insert #line directives in the output.
Ignore comment markers inside string and character literals
(bug reported by Amos Shapira <amos.shapira@netregistry.com.au>).
More accurate copyright notices.
2005-03-08 12:52:00 +00:00
harti
9719ee7af7 Add a debugging function that prints a message and appends the
current strerror.
2005-03-08 07:47:14 +00:00
harti
d28f5e232e Mark functions that don't return as dead. 2005-03-08 07:45:50 +00:00
harti
6bf66a2080 Finish constification of Var_Parse() and Var_Subst().
Patch:		0.18, 0.8, 7.110

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-03-08 07:43:57 +00:00
hmp
d059351ca6 Document the '-i' option which allows the user to specify a ktr events
log file.
2005-03-08 06:58:56 +00:00
harti
1cdb32f8eb Constify the callers of brk_string in this file.
Patch:		7.108

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-03-07 16:23:53 +00:00
harti
559a7bb274 Style: fix indendation of VarModify().
Patch:		7.107

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-03-07 16:14:50 +00:00
harti
44c51b91c7 Constify the input argument to brk_string.
Patch:		7.106

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-03-07 16:10:39 +00:00
harti
7a2e27092a Factor out the 'S' modifier into its own function. Move a variable
that is now used for both the 'M'/'N' branch and the 'S' branch of
the switch statement into a common scope.

Patch:		7.102-105
Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-03-07 16:08:39 +00:00
harti
360a1da14d Move the 'M' and 'N' modifiers into their own function.
Patch:		7.101

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-03-07 12:43:59 +00:00
alfred
6d55822ad3 Change fix a bug where the length of data written by snprintf was
being mishandled by using accumulation (into an uninitialized
variable) instead of direct assignment.

Reviewed by: scottl
2005-03-03 17:20:36 +00:00
harti
e701d73efd Style: remove unneeded parantheses in conditionals. 2005-03-03 11:34:04 +00:00
harti
ee1efc8131 Constify the code paths for the 'M' and 'N' modifiers.
Patch:		7.100

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-03-03 11:26:28 +00:00
harti
bed0867bba Fix parsing of archives: in System V archive format the member names
is terminated with a slash. Although we are not System V, ar has
been configured to put that slash in. This format allows filenames
with trailing spaces.
2005-03-03 10:46:23 +00:00
harti
e40b6c3875 Fix parsing of archive specifications on the target side of
dependency lines.  It seems that nobody is actually is using
the archive-feature of make.
2005-03-03 10:09:39 +00:00
harti
146cfcffbc Update the description comment of the function to reflect the
previous change.
2005-03-03 10:07:28 +00:00
harti
68bf1b2765 Transform VarParseLong() so that the lifetime and the constness of
variables gets clearer. Transform if() conditions to make the flow
clearer.

Patch:		7.93-99

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-03-03 07:25:04 +00:00