Jim Meyering [Thu, 27 Mar 2003 14:59:26 +0000 (14:59 +0000)]
Fix buffer overrun problem reported by TAKAI Kousuke, along
with some other POSIX incompatibilities.
(print_esc): Do not treat \x specially if
POSIXLY_CORRECT. Avoid buffer overrun if the format ends
in backslash. Treat incomplete escape sequences as strings
of characters, as POSIX requires.
(print_formatted): Allow multiple flags. Avoid buffer overrun
if the format is incomplete.
Jim Meyering [Sat, 22 Mar 2003 21:32:22 +0000 (21:32 +0000)]
Don't include <sys/sysmacros.h>.
That is already done via system.h. Otherwise, the multiple
inclusion would evoke redefinition warnings from Cray's /bin/cc
(Cray Standard C Version 4.0.3 (057126) Mar 22 2003 22:02:28).
(human_fstype): Factor some directives `up', out of this function.
Cast away `const' to avoid error from Cray's /bin/cc.
Jim Meyering [Sat, 22 Mar 2003 19:39:40 +0000 (19:39 +0000)]
(NEW_PATTERN): Cast alloca to proper type.
Otherwise, it wouldn't compile with at least /bin/cc on
ymp-cray-unicos9.0.2.X.
Combine two mostly-identical uses of alloca into one.
Jim Meyering [Thu, 20 Mar 2003 13:49:39 +0000 (13:49 +0000)]
(valid_format): Also accept ` ' and `'' as valid
format flag characters.
Do not require that a field width be specified.
Do not fail when given a field width of `0'.
Jim Meyering [Wed, 19 Mar 2003 23:00:25 +0000 (23:00 +0000)]
(.x.1): Use $(LN_S) instead of 'ln -s',
because the DJGPP 2.03 port of 'ln -s' doesn't work.
Include $(EXEEXT) in program names.
Since $(LN_S) may degenerate to `cp -p', be careful
to invoke it from the destination directory.
Mostly from Richard Dawe.
Jim Meyering [Wed, 19 Mar 2003 09:03:40 +0000 (09:03 +0000)]
(jm_MACROS): Include $(EXEEXT) in DF_PROG's program
name, since automake only adds $(EXEEXT) to programs in its *_PROGRAMS.
Arrange to compile the corresponding stub function if fchdir is missing.
Jim Meyering [Tue, 18 Mar 2003 17:47:06 +0000 (17:47 +0000)]
(read_filesystem_list) [MOUNTED_VMOUNT]: Detect any
error from mntctl.
Use mntctl's return value to drive the entry-processing loop, since
we can't rely on the value of the vmt_length member in the last
entry. On some systems doing so could result in an infinite loop.
Based in part on a patch from Mike Jetzer.
Jim Meyering [Tue, 18 Mar 2003 17:14:31 +0000 (17:14 +0000)]
(jm_LIST_MOUNTED_FILESYSTEMS): Move the MOUNTED_VMOUNT
test to precede the MOUNTED_GETMNTENT1 tests, since otherwise, AIX 5.1
systems would end up using the latter. MOUNTED_GETMNTENT1 support
is inadequate on such systems: 1) detecting whether a file system
is remote doesn't work 2) the MOUNTED_VMOUNT code reports the
HOSTNAME:/MOUNT_POINT, while the MOUNTED_GETMNTENT1 code reports
merely /MOUNT_POINT. Reported by Mike Jetzer.
Jim Meyering [Tue, 18 Mar 2003 15:39:45 +0000 (15:39 +0000)]
(ME_REMOTE): Recognize as remote any file system
that has an Fs_type with the `nfs' (any case) prefix.
This is necessary at least for AIX 5.1 when it uses the
MOUNTED_GETMNTENT1 code. Reported by Mike Jetzer.
Jim Meyering [Tue, 18 Mar 2003 08:43:57 +0000 (08:43 +0000)]
[struct Word] (paren, period, punct, final): Change the
type of each member from bool <MEMBER>:1 to unsigned int <MEMBER>:1.
AIX 5.1's xlc could not compile the former.
Jim Meyering [Mon, 17 Mar 2003 21:50:30 +0000 (21:50 +0000)]
(raise): Rename from rpl_raise.
Without that change, systems lacking raise (SunOS4) would not be
able to link programs using raise. Reported by Volker Borchert.
Jim Meyering [Mon, 17 Mar 2003 19:28:31 +0000 (19:28 +0000)]
(UTILS_FUNC_DIRFD): Test the cache variable, not one
that is guaranteed to be `no'. Use `no_such_member' to indicate
that condition, rather than `-1' which is slightly misleading.
Change the name of the cache variable to have the gl_ prefix.
Prompted by a patch from Richard Dawe for DJGPP.