Mike Makonnen
34a087543a
Gcc barfs in glob.c when run with -O3. To fix this make g_strchr() work on
...
and return (const Char *) pointers instead of just (Char *) and get rid of
all the type casting.
PR: kern/124334
2008-06-26 07:12:35 +00:00
Warner Losh
c879ae3536
Per Regents of the University of Calfornia letter, remove advertising
...
clause.
# If I've done so improperly on a file, please let me know.
2007-01-09 00:28:16 +00:00
Xin LI
1cec70ad72
- ANSIfy.
...
- Remove two unnecessary casts.
These changes would help gcc4 compile.
2006-06-05 18:22:13 +00:00
Andrey A. Chernov
4b767fa67f
Reflect size_t changes in glob.h
...
Obtained from: NetBSD (mostly)
2006-05-22 06:33:19 +00:00
Andrey A. Chernov
369316a848
Don't reuse *pl to skip [], it is already used for {} parts in the loop above
...
(submitted patch slightly modified)
PR: 86038
Submitted by: Gerd Rausch <gerd@juniper.net>
2005-09-14 19:14:32 +00:00
Tim J. Robbins
e9346e012d
Add support for multibyte characters.
2004-07-29 03:48:52 +00:00
Tim J. Robbins
4539e95a0f
Remove incomplete support for running FreeBSD userland on old NetBSD kernels
...
lacking the issetugid() and utrace() syscalls.
2003-10-29 10:45:01 +00:00
Mike Heffner
4a59c3ab55
Update glob(3) to add all the POSIX required options, specifically:
...
- add GLOB_NOMATCH return value and use it when we don't get a match
- rename GLOB_ABEND to GLOB_ABORTED and use it instead of returning 1
in some places
- add GLOB_NOESCAPE flag and retire GLOB_QUOTE to compatibility
section
Suggestions/advice on correct usage of POSIX defines: wollman
2002-07-17 04:58:09 +00:00
David E. O'Brien
b231cb3945
* Remove __P and convert to ANSI prototypes.
...
* Remove 'register'. (some functions had 7+ register functions...)
* Fix SCM ID's.
2002-02-01 01:32:19 +00:00
Mike Heffner
75dc5f1a82
Rename the GLOB_MAXPATH flag of glob(3) to GLOB_LIMIT to be compatible
...
with NetBSD and OpenBSD. glob(3) will now return GLOB_NOSPACE with
errno set to 0 instead of GLOB_LIMIT when we match more than `gl_matchc'
patterns. GLOB_MAXPATH has been left as an alias of GLOB_LIMIT to
maintain backwards compatibility.
Reviewed by: sheldonh, assar
Obtained from: NetBSD/OpenBSD
2001-07-29 00:52:37 +00:00
Peter Wemm
487dbd927f
Mostly pick up OpenBSD's rev 1.14 by deraadt@ and millert@.
...
I've left out a couple of unused args between internal functions.
Use MAXPATHLEN, not MAXPATHLEN + 1 in a couple of places.
Pass a pointer to the end of the target filename space.
2001-03-28 23:55:51 +00:00
Peter Wemm
27d52f6943
OpenBSD's g_Ctoc() returned a false error when the target buffer was
...
exactly the right size. Do it differently - pass a length rather than an
end-of-string+1 pointer as this is more convenient anyway. Get rid of
the bogus +1's.
2001-03-28 10:56:11 +00:00
Peter Wemm
76e2bc010d
Fix g_Ctoc() interface, approximately based on OpenBSD's recent changes.
...
Also, set gl_pathv to NULL after we free it, especially when dealing
with realloc failures.
Obtained from: OpenBSD
2001-03-28 09:53:16 +00:00
Jonathan Lemon
bae8632f82
Introduce the GLOB_MAXPATH flag, which allows the user to limit the
...
number of paths which glob(3) will return. Remove the hardcoded limit
from the last commit, which restores the previous unbounded behavior.
Document the new flag in the manual page.
2001-03-19 19:10:06 +00:00
Jonathan Lemon
daa4742e72
Bump MAX_GLOBENTRIES up to 16384, so it is a power of two. Add
...
some comments explaining that this is an arbitrary limit.
Requested by: jkh
2001-03-16 19:05:20 +00:00
Jonathan Lemon
813c96dbd7
Limit the number of paths that glob can return to MAX_GLOBENTRIES, which
...
is currently set to 10000. This is intended to prevent glob from running
amok when a highly recursive path is provided (such as "../*/../*/../*/...")
Reviewed by: Diane Bruce <db@db.net>, jhb
2001-03-15 18:50:32 +00:00
John Birrell
9fcbcd0217
NetBSD kernels don't have issetugid(), so #ifdef this out when
...
building FreeBSD's libc to run with a NetBSD kernel. We'll get to
the alpha kernel later, I promise. 8-)
1998-02-20 07:54:56 +00:00
Andrey A. Chernov
eb8eee5a55
Use getpwnam(getlogin()) before getpwuid(getuid())
1997-08-27 13:36:34 +00:00
Warner Losh
3fa69daee8
Don't getenv(HOME) when set[ug]od. This can lead to a buffer overflow and
...
elevated privs.
Obtained from: OpenBSD
1997-08-27 05:27:53 +00:00
Andrey A. Chernov
21d58869ce
Speedup in case locale not used
1997-04-04 19:16:08 +00:00
Warner Losh
62f187a4cf
Buffer overflow. Similar, but different, to the fix that Julian A submitted
...
in PR 2580.
Obtained from: BSDi by way of Keith Bostic
Should be in 2.2 and 2.1.x. I'll merge into 2.2.
1997-03-23 23:31:50 +00:00
Andrey A. Chernov
edcfa07284
collate_range_cmp -> __collate_range_cmp
1996-10-31 04:32:27 +00:00
Andrey A. Chernov
79deb12410
Convert to newly aded collate compare function
1996-08-12 18:49:54 +00:00
Andrey A. Chernov
89ec343a7f
Remove static collcmp, ise new internal function now
1996-08-12 03:45:53 +00:00
Andrey A. Chernov
b92a8919d1
Use collate for alpha character ranges
1996-08-12 02:00:56 +00:00
Rodney W. Grimes
6c06b4e2aa
Remove trailing whitespace.
1995-05-30 05:51:47 +00:00
Rodney W. Grimes
58f0484fa2
BSD 4.4 Lite Lib Sources
1994-05-27 05:00:24 +00:00