Jim Meyering
2e24888889
(regexec, re_search_stub) [!_LIBC]: Omit declaration of unused local, dfa.
...
(proceed_next_node): Remove outer declaration and
unnecessary initialization of local-shadowed `dest_node'.
Declare it in inner scopes, nearer its uses instead.
2005-08-12 13:16:26 +00:00
Jim Meyering
d7d1532698
(duplicate_node) [lint]: Set *new_idx to -1, to avoid
...
warnings (unfounded) in caller that it may be used uninitialized.
2005-08-12 13:10:17 +00:00
Jim Meyering
39a33e5f64
*** empty log message ***
2005-08-12 13:02:23 +00:00
Jim Meyering
956fd9d0d1
Mention that with FTS_LOGICAL, we use FTS_TIGHT_CYCLE_CHECK.
2005-08-12 13:02:17 +00:00
Jim Meyering
fe90fa6a61
(setup_dir, enter_dir, leave_dir, free_dir):
...
Use the hash-table-based cycle-detection code not just when
FTS_TIGHT_CYCLE_CHECK if specified, but also with FTS_LOGICAL.
Reported by James Youngman in
<http://lists.gnu.org/archive/html/bug-gnulib/2005-08/msg00011.html >.
2005-08-12 13:02:01 +00:00
Jim Meyering
6806c6a801
(fts_cross_check) [FTS_DEBUG]: s/active_dir_ht/fts_cycle.ht/.
2005-08-12 13:00:57 +00:00
Jim Meyering
fdaa1ce849
(IF_LINT): Define.
2005-08-12 12:41:56 +00:00
Jim Meyering
fa237b382f
(RE_SYNTAX_POSIX_AWK): Remove useless space-before-TAB.
2005-08-12 12:41:41 +00:00
Jim Meyering
0508157932
.
2005-08-02 21:15:19 +00:00
Jim Meyering
c5739dcf8e
*** empty log message ***
2005-08-02 20:47:46 +00:00
Jim Meyering
8822b68f9e
new files
2005-08-02 20:47:37 +00:00
Paul Eggert
317a0f7a07
Fix getdate bug with relative times.
2005-07-21 22:00:55 +00:00
Paul Eggert
217cd893ef
(relative_time): New type.
...
(RELATIVE_TIME_0): New constant.
(parser_control): Use relative_time instead of doing it ourselves.
(%union): Add new relative_time rel member.
(tYEAR_UNIT, tMONTH_UNIT, tHOUR_UNIT, tMINUTE_UNIT, tSEC_UNIT):
Now typeless.
(relunit, relunit_snumber): Now of type rel.
(zone, rel, relunit, get_date): Adjust to above changes.
2005-07-21 22:00:34 +00:00
Jim Meyering
f63845ae12
*** empty log message ***
2005-07-12 16:48:12 +00:00
Jim Meyering
40db6abec1
(X2NREALLOC): Define.
2005-07-12 16:47:37 +00:00
Jim Meyering
95550da8d3
.
2005-07-12 16:44:52 +00:00
Jim Meyering
eb3e6a0569
replace leading spaces with a TAB
2005-07-12 15:36:07 +00:00
Paul Eggert
7c97d643b9
(verify_expr): Use ((verify_type__ (R) *) 0), not
...
sizeof (verify_type__ (R)), to pacify C++ compilers.
2005-07-11 23:28:09 +00:00
Paul Eggert
6a406d5d8b
Reword copyright notices to conform to current GNU coding standards.
2005-07-11 21:59:08 +00:00
Paul Eggert
51ae476ad8
Parameterize the copyright symbol and the year.
2005-07-11 21:58:50 +00:00
Paul Eggert
8fb97bd54a
(COPYRIGHT_YEAR): New constant.
...
(version_etc_va): Use parameterized copyright notice.
Reword to conform to the current GNU coding standards.
2005-07-11 21:58:32 +00:00
Paul Eggert
d3fdc82a4e
(getloadavg) [__CYGWIN__]: Port to cygwin.
...
[__linux__]: Allocate a big enough buffer for /proc/loadavg.
[!LDAV_DONE]: Avoid unused variable warning.
2005-07-08 23:41:43 +00:00
Paul Eggert
64890758cf
(init_dfa, build_range_exp): Store __btowc value
...
in wint_t, not wchar_t. Remove now-unnecessary cast.
2005-07-08 17:58:35 +00:00
Paul Eggert
060594db56
Regenerate.
2005-07-08 00:35:04 +00:00
Paul Eggert
ce3bb28d95
Switch to Isamu Hasegawa's implementation of regex, which is
...
now in gnulib.
2005-07-08 00:23:15 +00:00
Paul Eggert
36a263effc
Add regcomp.c, regex_internal.c, regex_internal.h.
2005-07-08 00:22:14 +00:00
Paul Eggert
88ca28f3d7
(libcoreutils_a_SOURCES): Remove regex.h; gnulib
...
now does this automatically for us.
2005-07-08 00:14:05 +00:00
Jim Meyering
52c7a92b85
.
2005-07-07 17:59:05 +00:00
Jim Meyering
e74c15dd5a
fix typo in comment
2005-07-05 07:33:50 +00:00
Paul Eggert
6ef09ecf57
verify.h improvements.
2005-07-05 05:16:29 +00:00
Paul Eggert
5ad307bfc0
* verify.h (GL_CONCAT0, GL_CONCAT): Define unconditionally; don't
...
depend on whether verify_decl is defined.
(verify): Renamed from verify_decl. All uses changed.
Use an extern function decl, as it can't possibly collide with other
decls.
(verify_expr): Renamed from verify. All uses changed.
(verify_type__): New private macro.
(verify, verify_expr): Use it.
2005-07-05 05:16:08 +00:00
Jim Meyering
e2b7434615
rename: s/verify_dcl/verify_decl/
2005-07-04 17:39:48 +00:00
Jim Meyering
14ad8a2da7
*** empty log message ***
2005-07-04 16:09:10 +00:00
Jim Meyering
302c7df271
(libcoreutils_a_SOURCES): Add verify.h here, temporarily.
...
Eventually, it'll be pulled in via AC_LIBSOURCES.
2005-07-04 16:09:03 +00:00
Jim Meyering
979600d391
*** empty log message ***
2005-07-04 16:05:44 +00:00
Jim Meyering
cfdfe3e318
(verify, verify_dcl): New file/macros.
2005-07-04 16:05:41 +00:00
Jim Meyering
a54b48abe6
*** empty log message ***
2005-07-04 14:47:47 +00:00
Jim Meyering
13bda3c7c6
(verify_dcl): Rename from VERIFY. Update use.
2005-07-04 14:47:42 +00:00
Paul Eggert
9a00b08ea6
Remove the dependency of the strftime module on the tzset module.
2005-07-04 05:07:30 +00:00
Paul Eggert
d96382a5e9
(my_strftime) [! defined _LIBC && ! HAVE_RUN_TZSET_TEST]:
...
Copy the input structure, to work around some of the bug with
Solaris 2.5.1 and Solaris 2.6.
2005-07-04 05:06:44 +00:00
Jim Meyering
c719961a19
*** empty log message ***
2005-07-03 21:10:37 +00:00
Jim Meyering
035abbb7c6
(posixtime) [lint]: Initialize *all* of tm0, not just
...
the .tm_year member, since otherwise gcc-4.0 would now warn about
tm_zone, tm_gmtoff, tm_isdst, tm_yday, tm_wday.
2005-07-03 21:10:31 +00:00
Jim Meyering
685eb5f2c3
.
2005-07-03 13:47:39 +00:00
Jim Meyering
85ddb64559
.
2005-07-03 11:58:11 +00:00
Paul Eggert
c6a39d64c0
Minor fixes for port to Solaris 8.
2005-07-03 09:35:34 +00:00
Paul Eggert
0e11d335eb
Undo previous change.
2005-07-03 09:35:02 +00:00
Paul Eggert
ac1f5e4f90
Remove (sync from gnulib).
2005-07-03 09:28:55 +00:00
Paul Eggert
e3f2ac8a0f
New file, from gnulib.
2005-07-03 09:28:17 +00:00
Paul Eggert
067253007b
Sync from gnulib.
2005-07-03 09:27:38 +00:00
Paul Eggert
7e58462337
[! _LIBC]: Include "lstat.h" rather than rolling our own.
2005-07-03 09:27:22 +00:00
Paul Eggert
a90f160a33
(libcoreutils_a_SOURCES): Add fcntl--.h, stdio--h,
...
stdlib--.h, unistd--.h.
2005-07-03 09:26:59 +00:00
Jim Meyering
4f89ded6e2
*** empty log message ***
2005-07-03 09:07:28 +00:00
Jim Meyering
c1ef936462
Include <unistd.h> for declaration of close.
2005-07-03 09:07:22 +00:00
Paul Eggert
de0cf8356f
Regenerate.
2005-07-03 07:28:38 +00:00
Paul Eggert
e05ece2ced
Cleanup to isolate "safer" functions to a small part of the code.
2005-07-03 07:27:05 +00:00
Paul Eggert
9c34c16a06
Include fcntl--.h rather than fcntl.h.
...
Do not include unistd-safer.h.
(save_cwd): Don't call fd_safer; no longer needed
now that we include fcntl--.h.
2005-07-03 07:15:39 +00:00
Paul Eggert
6207fc885c
Include stdio--.h rather than stdio.h
...
and stdio-safer.h.
(getusershell): Call fopen, not fopen_safer.
2005-07-03 07:15:09 +00:00
Paul Eggert
bd1806f708
Include fcntl--.h rather than fcntl.h.
...
Do not include unistd-safer.h.
(getloadavg): Don't call fd_safer; no longer needed
now that we include fcntl--.h.
2005-07-03 07:14:28 +00:00
Paul Eggert
f21950385b
(fd_safer): Remove decl.
...
Include fcntl--.h rather than unistd-safer.h
(fts_safe_changedir): Don't call fd_safer; no longer needed
now that we include fcntl--.h.
2005-07-03 07:14:05 +00:00
Paul Eggert
98088e6a60
Include stdio-safer.h first, to check interface.
...
Don't bother including stdio.h, since stdio-safer.h does.
2005-07-03 07:13:31 +00:00
Paul Eggert
8b0a2afe9f
Add support for fcntl--.h, stdio--.h, stdlib--.h, unistd--.h, etc.
2005-07-03 06:43:07 +00:00
Jim Meyering
42f845ebc7
.
2005-07-02 14:33:56 +00:00
Jim Meyering
f0001d7346
*** empty log message ***
2005-07-02 11:56:56 +00:00
Jim Meyering
25ef400404
Assume HAVE_UNISTD_H, i.e., include <unistd.h> unconditionally.
2005-07-02 11:56:49 +00:00
Jim Meyering
06e5948dce
*** empty log message ***
2005-07-02 10:26:00 +00:00
Jim Meyering
dd2b7c95ff
Update from gnulib.
2005-07-02 10:25:58 +00:00
Jim Meyering
410f98fc2b
Assume HAVE_UNISTD_H, i.e., include <unistd.h> unconditionally.
2005-07-02 08:41:46 +00:00
Jim Meyering
58076430c3
Assume HAVE_FCNTL_H (i.e., include <fcntl.h> unconditionally,
...
and don't include <sys/file.h>).
2005-07-01 20:55:29 +00:00
Jim Meyering
ceaa11b643
*** empty log message ***
2005-07-01 20:53:36 +00:00
Paul Eggert
00fdbcc4af
* xnanosleep.c: Include timespec.h, since OpenBSD 3.4 <time.h>
...
declares only 'struct timespec;' (!).
2005-07-01 17:25:56 +00:00
Jim Meyering
c44874f722
.
2005-06-30 20:32:46 +00:00
Jim Meyering
d3f25798b9
Add copyright.
...
Include <fcntl.h> and <unistd.h> unconditionally --
it seems to be ok to do this, these days.
2005-06-30 20:23:09 +00:00
Jim Meyering
a3d8cfece3
*** empty log message ***
2005-06-30 20:23:00 +00:00
Jim Meyering
c17ae586bb
*** empty log message ***
2005-06-30 20:16:01 +00:00
Jim Meyering
5754380c82
Rewritten by Paul Eggert.
...
Now, the minimum overhead is just two system calls: dup and close.
2005-06-30 20:13:40 +00:00
Jim Meyering
58000d181c
New file. As yet unused.
2005-06-30 20:10:39 +00:00
Jim Meyering
36835110b6
*** empty log message ***
2005-06-30 16:40:08 +00:00
Jim Meyering
c25ccafa30
*** empty log message ***
2005-06-30 16:39:46 +00:00
Jim Meyering
5aa46e285c
[!VERIFY] (VERIFY): Define.
...
(ARGMATCH_VERIFY): Use it, so this macro may be used more than
once in any given scope.
2005-06-30 16:39:41 +00:00
Jim Meyering
4ff07ebe3c
(VERIFY_EXPR): Undef and add a comment.
2005-06-30 15:46:05 +00:00
Jim Meyering
b2915239d7
*** empty log message ***
2005-06-29 21:24:48 +00:00
Jim Meyering
eb231be3d6
(getuser, getuidbyname, getgroup, getgidbyname): Likewise.
2005-06-29 21:24:44 +00:00
Jim Meyering
2639d24e52
*** empty log message ***
2005-06-29 21:22:31 +00:00
Jim Meyering
dc59bb5133
(make_dir_parents): Don't apply sizeof to a hard-coded type name.
...
Use the variable name instead.
2005-06-29 21:22:06 +00:00
Jim Meyering
a9b919bde8
*** empty log message ***
2005-06-29 16:33:27 +00:00
Jim Meyering
22326600be
(VERIFY_EXPR): Define.
...
(X2REALLOC): New macro, to make using x2realloc a little safer.
2005-06-29 16:33:17 +00:00
Jim Meyering
f05347d1ee
.
2005-06-27 11:13:43 +00:00
Jim Meyering
7f7acc20fd
.
2005-06-27 08:50:22 +00:00
Jim Meyering
722379be04
(libcoreutils_a_SOURCES): Remove diacrit.c and diacrit.h.
2005-06-26 13:31:16 +00:00
Jim Meyering
88fc20a633
*** empty log message ***
2005-06-25 21:32:05 +00:00
Jim Meyering
a2013a21e1
(libcoreutils_a_SOURCES): Remove version-etc.c version-etc.h
...
and version-etc-fsf.c.
2005-06-25 21:31:59 +00:00
Jim Meyering
98172e8ab1
(libcoreutils_a_SOURCES): Remove dev-ino.h too, now that we
...
get it via root-dev-ino.m4
2005-06-25 21:25:42 +00:00
Jim Meyering
49d976e156
Remove dev-ino.h, now that we get it via root-dev-ino.m4
2005-06-25 21:25:29 +00:00
Jim Meyering
ef0790fc1c
*** empty log message ***
2005-06-25 12:35:23 +00:00
Jim Meyering
40a9612ec4
(libcoreutils_a_SOURCES): Remove root-dev-ino.c and root-dev-ino.h.
2005-06-25 12:35:13 +00:00
Paul Eggert
406929bb9d
(canon_host) [HAVE_GETADDRINFO]: Use = { 0, };' to initialize local
hint'.
2005-06-24 17:33:58 +00:00
Jim Meyering
534ccf18c2
.
2005-06-24 08:06:28 +00:00
Jim Meyering
a0e12540f5
*** empty log message ***
2005-06-23 18:41:55 +00:00
Jim Meyering
8ddb95f66c
(libcoreutils_a_SOURCES): Remove xstrtod.c and xstrtod.h.
2005-06-23 18:41:48 +00:00
Jim Meyering
5c215ef2ad
.
2005-06-23 16:34:18 +00:00
Jim Meyering
a2b5c6c00e
(libcoreutils_a_SOURCES): Remove xreadlink.c and xreadlink.h.
2005-06-23 16:24:32 +00:00
Jim Meyering
fba73bf741
*** empty log message ***
2005-06-23 13:26:20 +00:00
Jim Meyering
5fd26561cb
(backup_args): Change a `0' to NULL.
2005-06-23 13:26:15 +00:00
Paul Eggert
a13627ac2e
mktime fix to avoid a diagnostic.
2005-06-22 19:08:21 +00:00
Paul Eggert
8834b57877
Include <string.h> even if !DEBUG. (From glibc.)
...
(ranged_convert): Don't save conversion in a temporary struct.
This causes a warning with GCC 4.0.0, and anyway in the typical
case it's not worth the extra 100 bytes or so of code.
(ranged_convert, __mktime_internal): When calling a function via a
pointer P, use P () rather than (*P) (), as we now assume C89 or better.
2005-06-22 19:07:41 +00:00
Paul Eggert
956daabfc6
(desirable_utmp_entry): Fix bug where "who -b" and "who -r"
...
failed to give output.
2005-06-22 18:26:22 +00:00
Jim Meyering
fd78e66067
From gnulib:
...
(HAVE_GNU_CALLOC): New constant.
(xcalloc): Use it to avoid needless tests.
2005-06-22 11:55:38 +00:00
Jim Meyering
fb33aea31f
*** empty log message ***
2005-06-22 11:52:24 +00:00
Jim Meyering
7cb0b72a2c
.
2005-06-20 07:13:36 +00:00
Jim Meyering
b0e72c0a63
*** empty log message ***
2005-06-19 08:30:16 +00:00
Jim Meyering
2c4bb16c03
(libcoreutils_a_SOURCES): Remove xgetcwd.c, xgetcwd.h, xfts.c and xfts.h.
2005-06-19 08:25:21 +00:00
Jim Meyering
a5c9e15482
*** empty log message ***
2005-06-16 14:52:33 +00:00
Jim Meyering
5371690c7f
(rpl_calloc): Allocate a 1-byte buffer (not 1xS or Nx1)
...
when either N or S is zero.
2005-06-16 14:52:29 +00:00
Jim Meyering
7dd05aa715
Reflect s/_die/_fail/ renaming.
2005-06-15 09:38:12 +00:00
Jim Meyering
8add4ac9cb
*** empty log message ***
2005-06-15 08:32:14 +00:00
Jim Meyering
d4145e48ed
(make_dir_parents): Don't let a failed chdir($PWD)
...
stop us from restricting permissions of just-created absolute-named
directories.
2005-06-15 08:31:44 +00:00
Paul Eggert
f2c653e8df
Improve diagnostics for restore_cwd failure.
2005-06-14 23:58:00 +00:00
Paul Eggert
153854cc31
(make_dir): Remove. All uses replaced by mkdir.
...
(make_dir_parents): Last arg is now int * (for errno), not bool *.
Rewrite "mkdir -p" algorithm to avoid the need for "stat"
each time through the loop. Do not diagnose restore_cwd failure;
that is the caller's job (and perhaps the caller does not care).
2005-06-14 23:56:49 +00:00
Paul Eggert
616a6e5146
(make_dir): Remove. All uses replaced by mkdir.
...
(make_dir_parents): Last arg is now int * (for errno), not bool *.
2005-06-14 23:56:17 +00:00
Paul Eggert
d203fc19ae
mkdir-p cleanup.
2005-06-14 18:36:44 +00:00
Paul Eggert
f7bbc5d1a2
(CLEANUP_CWD, CLEANUP): Remove.
...
(make_dir_parents): Revamp to avoid need for CLEANUP_CWD, CLEANUP.
If the file already exists but is not a directory, don't bother
to try to make its parents.
Close potential file descriptor leak if we can't chdir("/") (!).
Don't always return true if chdir($PWD) fails; return true only
if the requested action was done successfully (except for the
chdir($PWD)).
Don't log final directory unless we actually made it.
Refactor to avoid duplicate code to fix up permissions.
Don't attempt to fix up parent permissions if chdir($PWD) fails.
2005-06-14 18:35:38 +00:00
Jim Meyering
5c3c5b0586
*** empty log message ***
2005-06-14 09:46:39 +00:00
Jim Meyering
b95fca684c
Reflect s/_die/_fail/ renaming.
2005-06-14 09:46:24 +00:00
Jim Meyering
f23e1c18a8
(openat_save_fail): Rename from openat_save_die.
...
(openat_restore_fail): Rename from openat_restore_die.
2005-06-14 09:44:54 +00:00
Jim Meyering
cb7512d04d
clarify comment
2005-06-14 08:55:37 +00:00
Jim Meyering
cb3b87f4d7
*** empty log message ***
2005-06-14 08:53:11 +00:00
Jim Meyering
1fbdda3dc2
(CLEANUP_CWD): Return *true*, not false when failing
...
to restore initial working directory.
2005-06-14 08:48:13 +00:00
Jim Meyering
a0e071d050
.
2005-06-14 08:19:18 +00:00
Jim Meyering
30b65617ac
*** empty log message ***
2005-06-14 06:55:32 +00:00
Jim Meyering
3e915a8263
(openat_save_die, openat_restore_die): New file.
2005-06-14 06:55:24 +00:00
Jim Meyering
5985c9991b
(openat_save_die, openat_restore_die): Declare and define.
2005-06-14 06:54:57 +00:00
Jim Meyering
8c98346f6f
Provide an alternative to exiting immediately upon save_cwd or
...
restore_cwd failure. Now, an application can arrange e.g.,
to perform a longjump in that case.
* openat.c: Include dirname.h.
Use IS_ABSOLUTE_FILE_NAME rather than testing for leading slash.
(rpl_openat, fdopendir, fstatat): Call openat_save_die
and openat_restore_die rather than calling error directly.
Don't include "error.h" or "exitfail.h"; they're no longer needed.
* openat-die.c (openat_save_die, openat_restore_die): New file.
* openat.h (openat_save_die, openat_restore_die): Declare and define.
2005-06-14 06:54:39 +00:00
Jim Meyering
57f2a7090c
*** empty log message ***
2005-06-13 10:22:29 +00:00
Jim Meyering
15de627dec
(make_dir_parents): Update prototype.
2005-06-13 10:22:26 +00:00
Jim Meyering
ecd375b64a
(make_dir_parents): New parameter: different_working_dir,
...
to tell caller if/when we change the working directory and are
unable to return to the initial one.
2005-06-13 10:15:19 +00:00
Jim Meyering
26438e44cd
*** empty log message ***
2005-06-12 19:56:42 +00:00
Jim Meyering
78c87e1292
(CLEANUP_CWD): Change one more return 1' to
return false'.
...
This fixes a bug introduced on 2004-07-30.
2005-06-12 19:56:37 +00:00
Paul Eggert
2bc139bf8f
Regenerate.
2005-06-02 05:19:46 +00:00
Paul Eggert
ef12d7fb52
Use "file name" when talking about file names, instead of "filename"
...
or "path", as per the GNU coding standards. As part of this,
rename makepath.c to mkdir-p.c, and path-concat.c to filenamecat.c,
and likewise for the .h files.
2005-06-02 05:06:56 +00:00
Paul Eggert
ab2edb9e33
Don't use "path" or "filename" to mean "file name"
...
in comments or local variable names.
2005-06-02 05:05:29 +00:00
Paul Eggert
1e6b9bd047
(excluded_file_name): Renamed from excluded_filename.
...
All uses changed.
2005-06-02 05:02:38 +00:00
Paul Eggert
d91f01988d
Don't use "path" or "filename" to mean "file name"
...
in comments or local variable names.
(excluded_file_name): Renamed from excluded_filename.
All uses changed.
2005-06-02 05:02:14 +00:00
Paul Eggert
1885506f1e
Renamed from path-concat.c.
...
(file_name_concat): Renamed from path_concat. All callers changed.
[TEST_FILE_NAME_CONCAT]: Renamed from TEST_PATH_CONCAT.
2005-06-02 04:59:10 +00:00
Paul Eggert
3a0841772c
Renamed from path-concat.h. All includers changed.
...
(file_name_concat): Renamed from path_concat. All callers changed.
2005-06-02 04:58:26 +00:00
Paul Eggert
6499782f2e
Renamed from makepath.h. All includers changed.
...
(make_dir_parents): Renamed from make_path. All callers changed.
2005-06-02 04:56:41 +00:00
Paul Eggert
78cd5b80f6
Renamed from makepath.c.
...
(make_dir_parents): Renamed from make_path. All callers changed.
2005-06-02 04:55:35 +00:00
Paul Eggert
ff57f59217
Regenerate.
2005-05-30 07:41:32 +00:00
Paul Eggert
53d6509846
_POSIX_VERSION cleanup
2005-05-30 07:37:02 +00:00
Paul Eggert
4ab39ecf75
(getpwnam, getgrnam, getgrgid)
...
[!defined _POSIX_VERSION]: Remove decls; not needed these days.
2005-05-30 07:31:12 +00:00
Paul Eggert
c86717d0dd
Include <limits.h> unconditionally, since other
...
files have been getting away with it for years (MORE/BSD 4.3
is extinct now).
2005-05-30 07:30:51 +00:00
Paul Eggert
fcb5c87adb
(getpwuid, getpwnam, getgrgid, getgrnam)
...
[!defined _POSIX_VERSION]: Remove decls; not needed these days.
2005-05-30 07:30:31 +00:00
Paul Eggert
241ed9e339
(getuid, getgid, getuid, getegid)
...
[!defined _POSIX_VERSION]: Remove decls; not needed these days.
2005-05-30 07:30:01 +00:00
Paul Eggert
b224f94761
(_POSIX_PATH_MAX) [!defined _POSIX_PATH_MAX]:
...
Define to 256, not 255, as per modern POSIX.
2005-05-30 07:05:07 +00:00
Paul Eggert
a73860cb2f
fts.c: Don't worry about debugging on pre-C99-comopatible hosts.
2005-05-28 00:00:38 +00:00
Paul Eggert
644cca3ead
Don't worry about debugging on pre-C99-comopatible hosts;
...
the configuration hassle isn't worth it.
Include inttypes.h and stdint.h unconditionally if FTS_DEBUG.
(LONGEST_MODIFIER, PRIuMAX): Remove.
2005-05-28 00:00:06 +00:00
Paul Eggert
606321fa32
Break integer-in-string comparison code out from src/sort.
2005-05-27 20:34:03 +00:00
Paul Eggert
a7102ac430
(fd_safer) [_LGPL_PACKAGE]: New static function,
...
so that unistd-safer.h (GPL'ed code) need not be included.
2005-05-22 17:29:46 +00:00
Jim Meyering
b72d60e7a4
*** empty log message ***
2005-05-21 06:44:36 +00:00
Jim Meyering
716ad689e0
fix typo in a comment
2005-05-21 06:42:41 +00:00
Paul Eggert
c84d7e1cb0
Import chown fixes from gnulib.
2005-05-20 22:48:40 +00:00
Paul Eggert
7a905c6ecc
(rpl_chown): Return -1 on failure.
2005-05-20 22:48:08 +00:00
Paul Eggert
e8ddf93a19
Regenerate.
2005-05-20 22:38:38 +00:00
Paul Eggert
8cc757279d
Split fts into LGPL'ed and GPL'ed parts.
2005-05-20 22:34:44 +00:00
Paul Eggert
6ee2045428
Don't include "cycle-check.h" or "hash.h".
...
(setup_dir, free_dir): New functions.
(enter_dir, leave_dir): Define trivial
alternatives of _LGPL_PACKAGE. Move to fts-cycle.c if !_LGPL_PACKAGE.
(HT_INITIAL_SIZE, ENTER_DIR): Remove. All uses removed.
(LEAVE_DIR): Fix typo: pass Fts and Ent to leave_dir.
(struct Active_dir, AD_compare, AD_hash, enter_dir, leave_dir):
Move to fts-cycle.c.
(fts_open): Use setup_dir.
(fts_close): Use free_dir.
(fts_read): Have just one copy of the ENTER_DIR code rather than three.
This adds a label and some gotos, but the alternatives were messier.
Check for memory allocation failure when entering a dir.
(fts_stat) [_LGPL_PACKAGE]: Bring back glibc cycle detection code.
2005-05-20 22:34:19 +00:00
Paul Eggert
fea1ba2d14
(_LGPL_PACKAGE) [defined _LIBC]: New macro.
...
(FTS): New member fts_cycle, that is a union that contains the
old active_dir_ht and cycle_state. All uses changed to mention
fts_cycle.ht and fts_cycle.state.
2005-05-20 22:33:59 +00:00
Paul Eggert
42aab6b2ae
New file, containing GPL'ed code migrated out of
...
fts.c, with the following changes:
(setup_dir, free_dir): New functions.
(enter_dir): Now returns bool. Return true if successful, false
if memory exhausted. All callers changed.
Do not bother partly cleaning up on
memory allocation failure; that is free_dir's job.
However, free ad if hash_insert fails, to avoid memory leak.
(enter_dir, leave_dir): Accommodate change to FTS by inspecting
fts->fts_options to see which union member to use.
2005-05-20 22:32:50 +00:00
Jim Meyering
ca88d7c411
*** empty log message ***
2005-05-20 04:27:00 +00:00
Jim Meyering
1222461ca6
(fts_open): Remove useless but otherwise harmless malloc call.
...
Spotted by Paul Eggert.
2005-05-20 04:26:35 +00:00
Jim Meyering
2334353619
*** empty log message ***
2005-05-19 08:54:44 +00:00
Jim Meyering
276ae5c469
(cannot_unlink_dir) [UNLINK_CANNOT_UNLINK_DIR]:
...
Use #define rather than a static function, to avoid a warning
when the function was not used.
2005-05-19 08:54:40 +00:00
Paul Eggert
666680ddaa
Regenerate.
2005-05-18 19:36:47 +00:00
Paul Eggert
0b5dba9efb
Remove some dependencies and old cruft from fts etc.
2005-05-18 19:32:57 +00:00
Paul Eggert
ae2b26dd0d
Do not include hash.h or cycle-check.h; no longer needed.
...
(FTS): Use struct hash_table * instead of Hash_table, so that
we no longer need to include hash.h here.
2005-05-18 19:29:11 +00:00
Paul Eggert
b569baa020
Include fts_.h first, to check interface.
...
Do not include intprops.h; no longer needed.
Include cycle-check.h and hash.h, since fts_.h no longer does.
Remove unnecessary casts of closedir to void.
(fts_build): Use a simpler method (not involving TYPE_SIGNED) to
decide whether to decrement nlinks.
2005-05-18 19:28:48 +00:00
Paul Eggert
0d3649e30d
Include canonicalize.h first, to test interface.
...
Include <stddef.h> unconditionally, since we assume C89 now.
All uses of PTR_INT_TYPE replaced by ptrdiff_t.
2005-05-18 19:28:21 +00:00
Paul Eggert
99ad01b0d5
Use geteuid, not getuid. Set "initialized" only if it was clear.
2005-05-15 05:57:31 +00:00
Jim Meyering
53a152ff60
.
2005-05-14 19:13:51 +00:00
Paul Eggert
070140df89
Regenerate.
2005-05-14 08:17:38 +00:00
Jim Meyering
afae3029ef
tweak cpp indentation on one line
2005-05-14 08:14:47 +00:00
Paul Eggert
7b18bf3811
* unlinkdir.c, unlinkdir.h: New files.
2005-05-14 08:09:23 +00:00
Jim Meyering
effcdb2647
remove recent temporary additions
2005-05-14 08:05:04 +00:00
Jim Meyering
8ac343fffa
Correct cpp indentation
2005-05-14 08:03:44 +00:00
Paul Eggert
2e71ba4dd2
New unlinkdir module.
2005-05-14 08:01:17 +00:00
Jim Meyering
116e6fb244
Update FSF postal mail address.
2005-05-14 07:58:06 +00:00
Jim Meyering
a5d7b5f8aa
One more
...
gethrxtime.c
2005-05-14 07:57:58 +00:00
Jim Meyering
f9be76236b
Add these temporarily:
...
unlocked-io.h
gethrxtime.h
mountlist.h
xtime.h
path-concat.c
2005-05-14 07:57:36 +00:00
Jim Meyering
c6db442aee
unlocked-io.h
2005-05-14 07:56:31 +00:00
Jim Meyering
7e387bd78d
.
2005-05-14 07:40:16 +00:00
Jim Meyering
e4a2650e94
.
2005-05-14 07:34:36 +00:00
Jim Meyering
a738692de4
.
2005-05-13 08:20:32 +00:00
Paul Eggert
d766c0a42a
(fts_sort): Optimize the common case where all pointers smell the same.
2005-05-09 23:54:26 +00:00
Paul Eggert
a7864df9ba
* fts_.h, fts.c: More C89 portability fixes.
2005-05-09 18:53:54 +00:00
Paul Eggert
3b3a3a9520
(__P): Remove. All uses rewritten to assume C89 or better.
...
(fts_open): Don't cast a function value in a possibly-unsafe way.
(fts_compar): New function.
(fts_sort): Use it.
2005-05-09 18:53:33 +00:00
Paul Eggert
3ed3fb2d81
(FTS): Use correct type for fts_compar member.
...
(FTSENT): New member fts_fts. Remove members fts_ino, fts_dev,
fts_nlink; no longer needed now that fts_statp is always there.
All uses changed to use fts_statp instead.
2005-05-09 18:53:11 +00:00
Paul Eggert
963e363388
* yesno.c: Include getline.h, not ctype.h.
...
(yesno): Don't remove leading white space; POSIX doesn't allow it.
Use getline to remove arbitrary restriction on response length.
2005-05-08 16:50:57 +00:00
Paul Eggert
3cccf50ce3
* makepath.c (make_path): chdir to "//", not "/", if the file name
...
starts with exactly two slashes.
2005-05-05 08:00:03 +00:00
Paul Eggert
280cc68071
(make_path): chdir to "//", not "/", if the file name
...
starts with exactly two slashes.
2005-05-05 07:59:48 +00:00
Paul Eggert
04d5428ad3
Regenerate.
2005-05-04 17:25:26 +00:00
Paul Eggert
ecf4669714
Sync from gnulib.
2005-05-02 04:28:20 +00:00
Paul Eggert
dfdf88d425
* modechange.h (mode_free): Remove; all callers changed to invoke 'free'.
...
* modechange.c: Likewise. Simplify internals a bit. Prohibit "+0".
2005-05-01 14:28:38 +00:00
Paul Eggert
394b469369
(mode_free): Remove; all callers changed to invoke 'free'.
2005-05-01 14:27:09 +00:00
Paul Eggert
d4502755f4
(mode_free): Remove; all callers changed to invoke 'free'.
...
xstrtol.h, stdbool.h, stddef.h: Don't include; no longer needed.
(MODE_DONE): New constant.
(struct mode_change): Remove 'next' member.
(make_node_op_equals): New function; like the old one of the
same name, except it allocates an array.
(mode_compile, mode_create_from_ref): Use it.
(mode_compile): Allocate result as an array, not a linked list.
Parse octal string ourself, so that we catch mistakes like "+0".
(mode_adjust): Arg is an array, not a linked list.
2005-05-01 14:26:50 +00:00
Paul Eggert
67a19c8e42
Regenerate.
2005-04-30 00:07:30 +00:00
Paul Eggert
89a64c09ba
Log yesterday's changes.
2005-04-30 00:06:06 +00:00
Paul Eggert
a516ac8256
(S_ISDIR, S_IRUSR, S_IRUSR, S_IWUSR, S_IXUSR): Remove.
...
[!_LIBC] Include "stat-macros.h" instead.
2005-04-29 05:34:55 +00:00
Paul Eggert
9eb4658295
* file-type.c: Include file-type.h first.
...
* filetype.h: Don't assume <sys/stat.h> was included first.
2005-04-28 16:48:14 +00:00
Paul Eggert
5580780a37
(MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
...
(struct mode_change): Move to modechange.c; callers don't
need to see this stuff.
(MODE_MASK_EQUALS, MODE_MASK_PLUS, MODE_MASK_MINUS, MODE_MASK_ALL):
(MODE_INVALID, MODE_MEMORY_EXHAUSTED, MODE_BAD_REFERENCE): Remove.
(mode_change, mode_adjust): Reflect the new signatures noted above.
2005-04-28 16:29:22 +00:00
Paul Eggert
498bb2796f
Include stat-macros.h, xalloc.h.
...
(S_ISDIR, S_ISUID, S_ISGID, S_ISVTX, S_IRUSR, S_IWUSR, S_IXUSR):
(S_IRGRP, S_IWGRP, S_IXGRP, S_IROTH, S_IWOTH, S_IXOTH, S_IRXWU):
(S_IRWXG, S_IRWXO, CHMOD_MODE_BITS):
Remove. This is now stat-macros.h's job.
(talloc): Remove. All callers replaced by xalloc, so that
our invokers don't have to worry about reporting memory failures.
(make_node_op_equals): Remove.
(MODE_ORDINARY_CHAGE, MODE_X_IF_ANY_X, MODE_COPY_EXISTING):
New constants.
(struct mode_change): Moved here from modechange.h.
(mode_append_entry): Remove.
(mode_compile): Remove MASKED_OPS arg, since it encouraged
apps to have incorrect behavior. Use simpler algorithm for head
and tail. Don't futz with umask; that's now the job of mode_adjust.
Detect more invalid usages rather than having somewhat-random behavior.
Don't insert an "a=" action, as that leads to incorrect behavior.
(mode_compile, mode_create_from_ref): Return NULL on error instead
of an enum, since now there's only one way to have an error. All
callers changed.
(mode_adjust): Accept new arg UMASK_VALUE, and interpret it
at the correct time. Simplify calculation of "+u" and its ilk.
Don't mishandle "+X".
(mode_free): Remove "register" and localize decls.
2005-04-28 16:29:00 +00:00
Paul Eggert
08e7216b2c
Regenerate.
2005-04-18 23:38:19 +00:00
Paul Eggert
441a757dc8
fetish -> coreutils in some more places
2005-04-18 23:33:55 +00:00
Paul Eggert
d1f3b4fe16
fetish->coreutils in compilation command.
2005-04-18 23:31:22 +00:00
Paul Eggert
93e5749eea
coreutils->fetish in comment.
2005-04-18 23:30:55 +00:00
Paul Eggert
8159d49a2a
(noinst_LIBRARIES): fetish -> coreutils.
...
(libcoreutils_a_SOURCES): Renamed from libfetish_a_SOURCES.
All uses changed.
(libcoreutils_a_LIBADD): Renamed from libfetish_a_LIBADD.
All uses changed.
(libcoreutils_a_DEPENDENCIES): Renamed from libfetish_a_DEPENDENCIES.
All uses changed.
2005-04-18 23:30:41 +00:00
Paul Eggert
5e54cfb18b
* getdate.y (zone): Allow relunit_snumber after tZONE.
2005-04-13 18:42:13 +00:00
Paul Eggert
f3f4a9add0
(zone): Allow relunit_snumber after tZONE, so
...
that "UTC +1 second" continues to work. Problem reported
by Dmitry V. Levin.
(relunit_snumber): New rule.
(relunit): Use it.
2005-04-13 18:42:00 +00:00
Paul Eggert
94e747e3ac
* getdate.y: Fix problem with parsing GMT time stamps during London summers.
2005-04-12 07:21:48 +00:00
Paul Eggert
1d6ad9ddf2
(universal_time_zone_table): New constant.
...
(time_zone_table): Remove GMT, UT, UTC entries; they're now in
universal_time_zone_table.
(lookup_zone): Prefer universal_time_zone_table to
local_time_zone_table, so that "GMT" time stamps are allowed in
London during the summer. Problem reported by Ian Abbott.
2005-04-12 07:21:18 +00:00
Paul Eggert
3aeec3ceed
Regenerate.
2005-04-11 20:21:07 +00:00
Paul Eggert
d233b6b31e
Add bulletproofing for cases where stdin, stdout, or stderr are closed.
2005-04-11 20:15:45 +00:00
Paul Eggert
6a0400397d
Add bulletproofing for cases where stdin, stdout, or stderr are closed.
2005-04-11 20:04:29 +00:00
Paul Eggert
5af96ecaf5
(libfetish_a_SOURCES): Remove dup-safer.c,
...
fcntl-safer.h, fopen-safer.c, open-safer.c, stdio-safer.h,
unistd-safer.h.
2005-04-11 20:03:40 +00:00
Paul Eggert
6d2aaeaa97
(fd_safer): New decl.
2005-04-11 20:03:22 +00:00
Paul Eggert
24560041a8
Include unistd-safer.h.
...
(save_cwd): Use fd_safer.
2005-04-11 20:03:04 +00:00
Paul Eggert
f4efb825d2
Include stdio-safer.h.
...
(getusershell): Use fopen_safer.
2005-04-11 20:02:43 +00:00
Paul Eggert
8bd8ca4bf3
Include unistd-safer.h.
...
(getloadavg): Use fd_safer.
2005-04-11 20:02:28 +00:00
Paul Eggert
01dbbdf612
Include unistd-safer.h.
...
(fts_safe_changedir): Use fd_safer.
2005-04-11 20:02:06 +00:00
Paul Eggert
74fdf19ae7
Include unistd-safer.h first, to test interface.
...
(dup_safer) [!deefined F_DUPD]: Use new fd_safer function instead of
rolling our own code.
2005-04-11 20:01:46 +00:00
Paul Eggert
10bcc8d795
Initial revision
2005-04-11 20:01:20 +00:00
Jim Meyering
31d1fd1eef
.
2005-04-09 17:29:20 +00:00
Jim Meyering
c06188c05c
(__attribute__, ATTRIBUTE_UNUSED): Define.
...
Mark parameter `sp' with ATTRIBUTE_UNUSED.
2005-04-09 14:19:49 +00:00
Jim Meyering
58415b5d5d
*** empty log message ***
2005-04-09 14:09:00 +00:00
Jim Meyering
c522a489df
(__attribute__, ATTRIBUTE_UNUSED): Define.
...
(exit_failure_callback, fallback_failure_callback): Mark unused
parameters with ATTRIBUTE_UNUSED.
2005-04-09 14:08:57 +00:00
Jim Meyering
22210b83b4
(canon_host) [HAVE_GETADDRINFO]: Use memset
...
rather than `= { 0 };' to initialize local `hint'.
2005-04-09 14:08:30 +00:00
Jim Meyering
517ac833b0
*** empty log message ***
2005-04-09 13:29:01 +00:00
Jim Meyering
5fb6300448
(posixtime) [lint]: Avoid spurious warning from gcc-4's
...
-Wuninitialized: initialize tm0.tm_year.
2005-04-09 13:28:25 +00:00
Jim Meyering
71984394f3
*** empty log message ***
2005-04-09 12:35:44 +00:00
Jim Meyering
89e0ab6c9e
(humblock): Set *options even when returning due to
...
xstrtoumax conversion failure. Thanks to a used-uninitialized
warning from gcc-4.
2005-04-09 12:35:41 +00:00
Paul Eggert
4c8c049f7a
Signal-handling cleanup motivated by core dumps in dd.
2005-04-09 05:00:40 +00:00
Paul Eggert
e4abcff12f
(rpl_nanosleep): Include "timespec.h" before macros
...
that might redefine system include files.
(siginterrupt) [!HAVE_SIGINTERRUPT]: New macro.
(my_usleep): Use NULL rather than (void *) 0.
(rpl_nanosleep) [!defined SA_NOCLDSTOP]:
Use siginterrupt to specify that system calls should be interrupted.
(rpl_nanosleep): Move initialization of suspended closer to call of
my_usleep.
2005-04-09 04:52:25 +00:00
Paul Eggert
cf6866dd8b
getdate patch for empty string near dst changes.
2005-04-04 19:52:07 +00:00
Paul Eggert
6be7cfe6d3
(parser_control): rels_seen is now a boolean, not a
...
count, since there's no maximum. All uses changed.
Add member dsts_seen.
(local_zone): Accumulate dsts_seen rather than relying on tm_isdst
not being INT_MAX.
(get_date): Initialize dsts_seen, and check that it doesn't go over 1.
Use pc_rels_seen to decide whther a date is absolute.
(number): Don't overwrite year.
(get_date): Initialize pc.year.digits to 0, not 4, to enable above check.
2005-04-04 19:51:49 +00:00
Paul Eggert
da54271e95
* readutmp.c (read_utmp) [!defined UTMP_NAME_FUNCTION]: Don't assume
...
utmp file is a regular file.
2005-03-30 07:40:17 +00:00
Paul Eggert
c315ff58b3
(read_utmp) [!defied UTMP_NAME_FUNCTION]: Add support for options.
...
Don't assume the file is a regular file.
2005-03-30 07:39:33 +00:00
Paul Eggert
3e5310af44
readutmp changes to allow checking for live pids
2005-03-30 05:19:48 +00:00
Paul Eggert
ec764b0a95
(read_utmp): New arg OPTIONS. All uses changed.
...
(UT_PID): Moved here from ../src/who.c.
(READ_UTMP_CHECK_PIDS): New constant.
2005-03-30 05:19:11 +00:00
Paul Eggert
196fb1bc5c
(read_utmp): New arg OPTIONS. All uses changed.
...
Include signal.h, stdbool.h.
(desirable_utmp_entry): New function.
(read_utmp) [defined UTMP_NAME_FUNCTION]: Redo memory allocation
using x2nrealloc, to simplify logic.
(read_utmp) [!defined UTMP_NAME_FUNCTION]: Check for overflow in
size calculation.
2005-03-30 05:18:37 +00:00
Jim Meyering
31927b4957
*** empty log message ***
2005-03-29 12:06:20 +00:00
Jim Meyering
363dc86fce
(long_options): Use NULL, not `0'.
2005-03-29 11:56:10 +00:00
Jim Meyering
db632b64c4
*** empty log message ***
2005-03-27 16:40:43 +00:00
Jim Meyering
3cb5dca5ce
(argmatch): Clarify comment: null-terminated -> NULL-terminated.
2005-03-27 16:40:02 +00:00