Commit Graph

7654 Commits

Author SHA1 Message Date
ru
ba39d66f14 Silence a warning on systems without carp(4). 2005-04-12 08:47:04 +00:00
stefanf
30e304f59d 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
7c74744edb Parse_Init() is gone so remove comments that mention it. 2005-04-11 07:40:54 +00:00
harti
c1f7927d0b 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
f3a646433b 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
6fd4d9a1ee 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
ac58626784 Add myself to the calendar.
MFC after: 	1 week
Approved by:	simon (mentor)
2005-04-10 19:03:48 +00:00
stefanf
a53739d7ee Remove unused variables. 2005-04-09 14:31:41 +00:00
murray
03a843118e Commodore Perry was not 4 years old when he sailed to Japan. Correct
birth year.
2005-04-08 09:50:30 +00:00
joel
8479d7ff08 Add myself (and decrease the average age).
Approved by:	brueffer (mentor)
2005-04-08 09:04:29 +00:00
harti
c1b16db069 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
32fe258978 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
962d0440fe 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
c24ff5be7a 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
4defd5473a 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
cb9fe5f778 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
0b3bbfc5ab Remove lots if irritating parantheses and fix two comments.
Checked by:	md5
2005-04-05 08:09:48 +00:00
harti
009596bf79 Remove the definition for STATIC and just use static. 2005-04-05 07:44:11 +00:00
harti
3112ed9747 Remove unneccessary local prototypes. 2005-04-05 07:43:02 +00:00
harti
9b7bc7a647 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
584297b3c4 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
e17c93f393 Include <string.h> and <strings.h> for various functions. 2005-04-04 21:19:48 +00:00
pjd
660343c329 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
b2a7e9bcff Don't refer to devices that don't exist. 2005-04-03 05:19:45 +00:00
tanimura
a690651f10 Commemorate the bicentenary of Hans Christian Andersen's birth by
adding his birthday.
2005-04-02 09:27:13 +00:00
tjr
fcc1b63326 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
6659154332 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
91352e7965 Remove a forward declaration that isn't needed anymore. 2005-04-01 16:23:48 +00:00
harti
874cbfd73f 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
e9c08dff47 Style: fix indentation. 2005-04-01 13:25:45 +00:00
harti
c8ab0dc5d1 Style: fix indentation. 2005-04-01 13:06:05 +00:00
harti
d5cee0d8f0 Style: indentation. 2005-04-01 13:02:17 +00:00
harti
cb601192b1 Style: Indentation. 2005-04-01 12:42:03 +00:00
harti
446fc783f9 Style: fix indentation. 2005-04-01 12:31:15 +00:00
harti
478249bcc9 Style: fix indentation. 2005-04-01 11:20:17 +00:00
harti
d0680048d7 Style: fix indentation. 2005-04-01 11:12:29 +00:00
harti
e61a7b3518 Style: fix indentation. 2005-04-01 10:53:43 +00:00
cperciva
c79e1b8857 Note the passing of Cameron Grant <cg@FreeBSD.org>.
Approved by:	quiet1
2005-03-31 23:15:14 +00:00
harti
7f77c83326 Document the new -A flag for ignoring archive errors. 2005-03-31 11:40:53 +00:00
harti
7eaac50b97 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
96d088cb0f 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
5545d6dc80 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
fb0048db69 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
916f303c0f Add directory hierarchy copying example. 2005-03-28 18:18:44 +00:00
obrien
6f75b81ed9 Note when 'stat' appeared in FreeBSD. 2005-03-28 04:02:45 +00:00
alfred
fbf5f18034 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
187844b0ae 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
2ccd8741aa Style: de-lispify by removing extra parantheses in conditional expressions. 2005-03-23 16:28:57 +00:00
harti
1a7eb00094 Style: make indentation 8 characters. 2005-03-23 16:14:41 +00:00
harti
8dd50a52f6 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