Commit Graph

7486 Commits

Author SHA1 Message Date
harti
d48c22c744 Move the check for the error case (variable ends without a closing
paranthesis or brace) into the loop and don't leak the buffer in this
case. Remove the check for Var_Parse returning NULL - it can't.

Patch:		7.92

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-03-02 15:52:04 +00:00
harti
e7c29f62ab Fix indentation on a block of code.
Patch:		7.91

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-03-02 14:43:40 +00:00
harti
61cd56f1b8 Push the length computation down into VarParseShort().
Return always malloc()-ed strings from VarParseShort() to get
rid of warnings when returning string constants from a non-const char *
function.

Patch:		7.90

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-03-02 14:30:36 +00:00
harti
4d02f53ee7 Convert a function call to Lst_ForEach with a macro call to LST_FOREACH. 2005-03-02 12:00:21 +00:00
trhodes
0c94f7d5b7 Wrap BSD r* commands in NO_RCMDS.
Change NO_RCMDNS to NO_RCMDS and do the switch in bsd.compat.mk.

Discussed with: ru, nectar
2005-03-02 11:53:22 +00:00
jcamou
89450ddd8c Add an entry for myself.
Approved by:	trhodes (mentor)
2005-03-02 09:08:17 +00:00
harti
8778b6d48b Use the LST_FOREACH macro instead of the Lst_ForEach function. This
saves function calls and reduces void casting.
2005-03-02 08:30:49 +00:00
harti
c842d10617 Make sure the length variable is initialized to 0 before passing
it to Var_Parse().

Patch:		7.85

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-03-01 17:52:18 +00:00
harti
720410d2c4 Split out ParseModifiers from VarParseLong.
Patch:		7.84
Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-03-01 12:26:32 +00:00
harti
0b2f8659a4 VarParseLong: Create new else block for haveModifier. Move the call
to VarExpand down into the branches of the if as well as cleanup code.
Eliminate code that is now obviously dead.

Patch:		7.83

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-03-01 12:22:07 +00:00
flz
25c47f61d7 Add myself to the calendar.
Feel free to send presents :)

Approved by:	pav (mentor)
2005-03-01 11:48:36 +00:00
harti
f1e9ce6a9d Reverse a condition so that the else clause can be changed
to a fallthrough.

Patch:		7.82

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-03-01 07:58:18 +00:00
harti
7f0590be82 VarParseLong: Move the initialisation of dynamic up which saves
an else clause. Move the assignment to the lengthPtr down to
just before the return statements.

Patch:		7.81

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-02-28 17:23:17 +00:00
harti
152b6f5d7a Buf_GetAll wants a pointer as its second argument, not a boolean -
replace FALSE by NULL.

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-02-28 17:05:26 +00:00
harti
af7db1ea0a Don't modify the input string in VarParseLong(). It is not
necessary to NUL-terminated it, because we know the lengths
from the pointers.

Patch:		7.80

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-02-28 15:01:37 +00:00
barner
ad571e921b Add my birthday.
Approved by:	arved (mentor)
2005-02-27 21:34:08 +00:00
ru
886aafe32a Make the format of LC_COLLATE files architecture independent. 2005-02-27 20:31:13 +00:00
phantom
78dff7ec9b Fix two cut'n'paste'os which violated format of NLS catalogs 2005-02-27 19:42:48 +00:00
ru
a1155f1ca5 Fix build on sparc64. 2005-02-27 19:37:51 +00:00
phantom
c57c50bc3b Remove unused now stuff, also set WARNS to 8 2005-02-27 16:25:14 +00:00
phantom
752c0b526b Bring in NetBSD's improvements and cleanups to NLS subsystem, making
it type and endian clean.

Also following changes were done:

. Remove of outdated support for generating of include files for
  NLS catalogs being generated.
. Integrate my old code optimizations
. ANSI'fy prototypes
. Remove duplicate defines, and cleanup includes
. Remove first (unused) argument from error() function
. Const'ify (gencat now WARNS=8 clean)
. Convert corrupt() and nomem() functions to macros
. Add *temporary* note what '-new' command line argument is
  deprecated now (instead of exiting with error message)

WARNING: format of generated .cat files is changed!

XXX: re-add support for *updating* of .cat files, NetBSD has this
functionality disabled

Obtained from:	NetBSD (mostly)
2005-02-27 16:23:14 +00:00
ru
de6003f022 Zero out the entire "struct __collate_st_chain_pri", or garbage
appears in LC_COLLATE files (due to alignment).  An alternative
would be to bump STR_LEN to 16.

(This is in preparation to make LC_COLLATE files architecture
independent.)
2005-02-27 14:05:38 +00:00
gad
35a8edad83 MFC 1.22: Fix -0 vs -L/-I processing, mainly so that 'xargs -0 -I []' will
do something sensible (namely: treat then '\0' as the EOL character, when
deciding what "a line" is for -N).  Note that  -I implies -N.

MFC after:	3 days
2005-02-27 01:35:54 +00:00
ru
215081ffba Make the format of LC_CTYPE files architecture independent by
introducing the disk formats for _RuneLocale and friends.

The disk formats do not have (useless) pointers and have 32-bit
quantities instead of rune_t and long.  (htonl(3) only works
with 32-bit quantities, so there's no loss).

Bootstrap mklocale(1) when necessary.  (Bootstrapping from 4.x
would be trivial (verified), but we no longer provide pre-5.3
source upgrades and this is the first commit to actually break
it.)
2005-02-26 21:47:54 +00:00
harti
c7007db817 Major clean up and split the Var_Parse monster function into three
functions: one for the single letter variables, one for the others
and one that does the recursive expansion.

Patches:	7.68-7.79

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-02-26 08:54:40 +00:00
trhodes
11880a1bd0 Fix mismerge.
Noticed by:	tjr
2005-02-26 04:14:20 +00:00
harti
2ddbdd3ecb Change the return value of Var_Subst to return a Buffer instead
of a char *.

Patch:		7.49

Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-02-25 13:16:56 +00:00
sem
2c023d28c9 Fix a typo in my last commit.
Reported by:	ceri
2005-02-24 18:17:41 +00:00
sem
bb995cf804 Put my birthday into the pool.
Sorry guys, USSR idiosyncrasy.
2005-02-24 17:08:39 +00:00
harti
4e0c48e6b2 Var_Parse: Separate different error states by introducing an else block
after a return. Move assignments to {freePtr, dynamic, start} closer to the
return statements to clarify which variables are actually used for
communication between the losely coupled blocks of the code. Clear up
an if-expression to make common structures of the conditions clearer.
Use strchr instead of switch statements to check for a character beeing
a member of a set.

Patches:	7-62.2, 7-62.3, 7-64, 7-65.1, 7-65.2
Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-02-24 16:05:45 +00:00
harti
2aa59c2f63 Push assignments to just before the returns from the function to
get it clearer what variables are actually needed.

Patches:	7.62.2, 7.62.3
Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-02-24 10:35:39 +00:00
harti
06004c6dc3 Fix wording of a comment.
Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-02-24 10:30:23 +00:00
harti
a0efca0f99 Replace the calls to Lst_ForEach with the new LST_FOREACH macro and
fix the prototype for Compat_RunCommand to take the actual argument
types instead of void *.
2005-02-24 10:23:31 +00:00
trhodes
861533551b Add better mdoc(7) mark up, clean up wording, better describe the effects
of some arguments.

PR:				47705
Based on a patch submitted by:	Gary W. Swearingen <swear@attbi.com>
Glanced at by:			simon
2005-02-23 22:40:45 +00:00
harti
23175159b5 Use the LST_FOREACH macro instead of the Lst_ForEach function
and so get rid of the ForExec helper function by inlining it
into For_Run.
2005-02-23 14:03:18 +00:00
harti
8969771651 Style: fix indent, use tabs instead of space+tab for aligning things.
Add a couple of comments.
2005-02-23 13:58:56 +00:00
harti
66124f36b4 Fix the indendation of some multi-line comments.
Noted by:	Max Okumoto <okumoto@ucsd.edu>
2005-02-23 10:20:58 +00:00
ru
461fe26961 Add endianness support to cap_mkdb(1), useful for cross builds. 2005-02-22 23:29:54 +00:00
glebius
208cc8a844 Add CARP (Common Address Redundancy Protocol), which allows multiple
hosts to share an IP address, providing high availability and load
balancing.

Original work on CARP done by Michael Shalayeff, with many
additions by Marco Pfatschbacher and Ryan McBride.

FreeBSD port done solely by Max Laier.

Patch by:	mlaier
Obtained from:	OpenBSD (mickey, mcbride)
2005-02-22 13:04:05 +00:00
harti
dcac53a32d Fix the prototypes by addings some constness. This should have been
committed together with the commit to dir.c:1.48.
2005-02-22 08:17:05 +00:00
harti
16c7b161af Use the new LST_FOREACH macro throughout the file and replace calls to
Lst_ForEach and Lst_Find.
2005-02-22 08:00:06 +00:00
harti
cc70147d10 Invent the LST_FOREACH macro for looping through a list. In contrast
to the Lst_ForEach function this macro reduces the number of function
calls per invocation by N + 1 (where N is the number of list elements)
and increases code locality thereby increasing readability and
(maybe) performance.
2005-02-22 07:58:53 +00:00
ps
9de5ed2486 Fix an overflow when calculating the number of kilobytes from the
number of pages.

Obtained from:	Yahoo!
2005-02-21 14:35:00 +00:00
harti
11a97cc4a9 Style: fix indendation to be 8 and use tabulators. Fix lines longer than
80 characters and slightly reorder functions to get rid of static
prototypes.
2005-02-21 13:36:22 +00:00
harti
752cf25142 Forgot to set *freePtr to FALSE in another place.
Submitted by:	Max Okumoto <okumoto@ucsd.edu>
2005-02-21 08:10:21 +00:00
harti
d0a8599bcf Fix a bug in handling archive members: when a member was not found
when looking into an already hashed archive, the code tried to use
the name shortened to the maximum length allowed for the archive.
Unfortunately it passed a buffer of junk to the hashing routine when
the name actually wasn't too long. Theoretically this could lead to
a false positive.
2005-02-21 08:06:34 +00:00
ru
f21a45fb33 Fixate the hash bucket size to 4K. We were using the default,
which is stat.st_blksize (i.e., PAGE_SIZE).

This change causes the .db files that were cross-compiled on
another platform to be identical to the natively built ones.

Tested on:	alpha->amd64 build
2005-02-19 23:59:49 +00:00
ume
6f86e1feb0 simply ignore unknown address family.
MFC after:	1 week
2005-02-19 16:54:26 +00:00
ume
c897882706 teach IPv6 to `systat -netstat'.
Tested by:	kuriyama
MFC after:	1 week
2005-02-19 15:10:19 +00:00
wollman
6998ea1bf3 Support correct programming environment name for amd64.
MFC after:	3 days
2005-02-18 21:53:05 +00:00