Files
MSYS2-packages/rcs/rcs-5.9.4-upstream.patch
atom.long 95d3a65a04 rcs:
(1) add makedepends "groff"
(2) update gnulib code
(3) add rcs-5.9.4-upstream.patch
(4) new msysize patch for rcs-5.9.4
2017-05-31 00:11:18 +08:00

4739 lines
144 KiB
Diff
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
diff --git rcs-5.9.4.orig/ChangeLog rcs-5.9.4/ChangeLog
index 8dca5d0..822e4e4 100644
--- rcs-5.9.4.orig/ChangeLog
+++ rcs-5.9.4/ChangeLog
@@ -1,3 +1,62 @@
+2016-11-30 Thien-Thi Nguyen <ttn@gnu.org>
+
+ [boot int] Precisely delete files backed-up by gnulib-tool --copy-file.
+
+ * autogen.sh (actually): Do rm -f here...
+ <top-level>: ...instead of here.
+
+2016-10-25 Thien-Thi Nguyen <ttn@gnu.org>
+
+ [doc] Mention hyphens w/ rlog -zZONE.
+
+ * doc/rcs.texi (rlog): ...as opposed
+ to slashes, here, in the options table.
+
+2016-10-16 Thien-Thi Nguyen <ttn@gnu.org>
+
+ [build int] Use gnulib module memchr.
+
+ * m4/gnulib-cache.m4 (gl_MODULES): Add memchr.
+
+2016-10-14 Thien-Thi Nguyen <ttn@gnu.org>
+
+ Fix typo: Spell "responsible" correctly.
+
+ * doc/rcs.texi (Credits): ...here.
+
+2016-10-14 Thien-Thi Nguyen <ttn@gnu.org>
+
+ [doc] Say "standard output" instead of "stdout".
+
+ * doc/rcs.texi (co, merge, rcsmerge): ...here.
+
+2016-10-13 Thien-Thi Nguyen <ttn@gnu.org>
+
+ [doc] Fix bug: Add space between merge option -L and its arg.
+
+ * doc/rcs.texi (merge): ...here.
+
+2015-02-02 Thien-Thi Nguyen <ttn@gnu.org>
+
+ [slog] Consult USER before LOGNAME if latter is configure-time readonly.
+
+ * configure.ac (rcs_cv_LOGNAME_ro): New AC_CACHE_CHECK.
+ (USER_OVER_LOGNAME): New RCS_CBOOL.
+ * doc/rcs.texi (Environment): Mention possible order
+ inversion of env var checks in footnote; remove paren pair.
+
+2015-01-23 Thien-Thi Nguyen <ttn@gnu.org>
+
+ [build slog] Avoid "date -r".
+
+ Apparently, "date -r" is not POSIX. Reported by Michael Felt:
+ <http://lists.gnu.org/archive/html/bug-rcs/2015-01/msg00006.html>.
+
+ * configure.ac (rcs_cv_sane_mmap) [AIX]: Don't compare
+ file timestamp before and after the mmap operation; instead,
+ create two files in determined temporal order and check that
+ the mmap operation does not change that order.
+
2015-01-22 Thien-Thi Nguyen <ttn@gnu.org>
Release: 5.9.4
@@ -2232,7 +2291,7 @@ Thu Jan 11 16:32:50 1990 Paul Eggert <eggert@twinsun.com>
timezones can collaborate.
-Copyright (C) 2010-2015 Thien-Thi Nguyen
+Copyright (C) 2010-2017 Thien-Thi Nguyen
Copying and distribution of this file, with or without modification,
are permitted provided the copyright notice and this notice are preserved.
diff --git rcs-5.9.4.orig/Makefile.am rcs-5.9.4/Makefile.am
index 2e8545d..d5dcaf9 100644
--- rcs-5.9.4.orig/Makefile.am
+++ rcs-5.9.4/Makefile.am
@@ -1,6 +1,6 @@
# Master makefile for RCS
-# Copyright (C) 2010-2015 Thien-Thi Nguyen
+# Copyright (C) 2010-2017 Thien-Thi Nguyen
#
# This file is part of GNU RCS.
#
diff --git rcs-5.9.4.orig/NEWS rcs-5.9.4/NEWS
index 37d6050..84c5e14 100644
--- rcs-5.9.4.orig/NEWS
+++ rcs-5.9.4/NEWS
@@ -1030,7 +1030,7 @@ See the end for copying conditions.
Copyright information:
- Copyright (C) 2010-2015 Thien-Thi Nguyen
+ Copyright (C) 2010-2017 Thien-Thi Nguyen
Copyright (C) 1991, 1992, 1993, 1994, 1995 Paul Eggert
Permission is granted to anyone to make or distribute verbatim copies
diff --git rcs-5.9.4.orig/README rcs-5.9.4/README
index 053742a..3afd59d 100644
--- rcs-5.9.4.orig/README
+++ rcs-5.9.4/README
@@ -244,6 +244,10 @@ configure script skips the related tests and assumes the following defaults:
Values are optimistic, unlike for the vars described at the beginning of
this section, but anyway can be overridden in the usual manner.
+Another variable is rcs_cv_LOGNAME_ro with optimistic value "no", which
+controls the order of the env vars consulted (normally LOGNAME before USER).
+If "yes", RCS is built to consult USER before LOGNAME.
+
If you get good results cross-compiling, with or without such variable
overrides, please consider sharing the good news by posting the configure
script invocation to the bug-report address with subject "cross-compilation
@@ -284,7 +288,7 @@ X_DEFAULT - This is normally ",v/" on Unix hosts, and "" on hosts that
do not allow commas in file names (e.g. DOS).
-Copyright (C) 2010-2015 Thien-Thi Nguyen
+Copyright (C) 2010-2017 Thien-Thi Nguyen
Copying and distribution of this file, with or without modification,
are permitted provided the copyright notice and this notice are preserved.
diff --git rcs-5.9.4.orig/THANKS rcs-5.9.4/THANKS
index 8675cb5..67ef2c0 100644
--- rcs-5.9.4.orig/THANKS
+++ rcs-5.9.4/THANKS
@@ -58,4 +58,5 @@ and reporting bugs (sometimes with fixes) for these releases:
Achim Gratz
Hannes Küttner
Christian Wagner
+ Michael Felt
(and others who prefer anonymity)
diff --git rcs-5.9.4.orig/build-aux/extract-help rcs-5.9.4/build-aux/extract-help
index a8c971c..0aba493 100755
--- rcs-5.9.4.orig/build-aux/extract-help
+++ rcs-5.9.4/build-aux/extract-help
@@ -1,7 +1,7 @@
#!/bin/sh
# extract-help
#
-# Copyright (C) 2010-2015 Thien-Thi Nguyen
+# Copyright (C) 2010-2017 Thien-Thi Nguyen
#
# This file is part of GNU RCS.
#
diff --git rcs-5.9.4.orig/configure.ac rcs-5.9.4/configure.ac
index a5efcbe..0fa1cfe 100644
--- rcs-5.9.4.orig/configure.ac
+++ rcs-5.9.4/configure.ac
@@ -1,6 +1,6 @@
# Configure template for RCS
-# Copyright (C) 2010-2015 Thien-Thi Nguyen
+# Copyright (C) 2010-2017 Thien-Thi Nguyen
# Copyright (C) 1995 Paul Eggert
#
# This file is part of GNU RCS.
@@ -450,14 +450,14 @@ AC_CACHE_CHECK([that `mmap' is sane],[rcs_cv_sane_mmap],[
# AIX 3.2.0 read-only mmap updates last-modified time of file!
AS_CASE([$cross_compiling],[no],[AS_CASE([$build_os],[*-aix* | aix*],[
echo nonempty > conftest.data
- bef=`date -r conftest.data`
- sleep 2
+ sleep 1
+ echo later > conftest1
+ sleep 1
dnl Note that we need not specify ACTION-IF-CROSS-COMPILING
dnl for the AC_RUN_IFELSE as the surrounding (^2) AS_CASE
dnl skips this block (and jam res=no) if actually cross-compiling.
AC_RUN_IFELSE([SIMPLE_MMAP_PROGRAM])
- aft=`date -r conftest.data`
- test "$bef" = "$aft" || res=no
+ test conftest1 -nt conftest.data || res=no
])],[res=no])
rcs_cv_sane_mmap=$res
])
@@ -526,6 +526,18 @@ RCS_CBOOL([BAD_WAIT_IF_SIGCHLD_IGNORED],[no],[rcs_cv_tolerant_wait],
# miscellaneous
+AC_CACHE_CHECK([if env var LOGNAME is readonly],[rcs_cv_LOGNAME_ro],[
+AS_IF([RCS_YESP([cross_compiling])],[rcs_cv_LOGNAME_ro=no],[
+saved_LOGNAME="$LOGNAME"
+LOGNAME=x"$LOGNAME" 2>/dev/null
+AS_IF([test "$LOGNAME" = "$saved_LOGNAME"],
+ [rcs_cv_LOGNAME_ro=yes],
+ [rcs_cv_LOGNAME_ro=no
+ LOGNAME="$saved_LOGNAME"])
+])])
+RCS_CBOOL([USER_OVER_LOGNAME],[yes],[rcs_cv_LOGNAME_ro],
+[Consult env var USER before env var LOGNAME?])
+
AS_IF([RCS_YESP([GCC])],,[enable_coverage=no])
AS_IF([RCS_YESP([enable_coverage])],[CFLAGS="$CFLAGS --coverage"])
RCS_CBOOL([USE_NORMAL_EXIT],[yes],[enable_coverage],
diff --git rcs-5.9.4.orig/doc/Makefile.am rcs-5.9.4/doc/Makefile.am
index d15a8af..583bd33 100644
--- rcs-5.9.4.orig/doc/Makefile.am
+++ rcs-5.9.4/doc/Makefile.am
@@ -1,6 +1,6 @@
# Make RCS info pages (and other formats, too).
-# Copyright (C) 2010-2015 Thien-Thi Nguyen
+# Copyright (C) 2010-2017 Thien-Thi Nguyen
#
# This file is part of GNU RCS.
#
diff --git rcs-5.9.4.orig/doc/rcs.texi rcs-5.9.4/doc/rcs.texi
index c0577b4..6780995 100644
--- rcs-5.9.4.orig/doc/rcs.texi
+++ rcs-5.9.4/doc/rcs.texi
@@ -52,7 +52,7 @@ Note that @option{-V@var{n}} is @emph{not} a valid option for
@copying
This manual is for GNU RCS (version @value{VERSION}, @value{UPDATED}).
-Copyright @copyright{} 2010--2015 Thien-Thi Nguyen
+Copyright @copyright{} 2010--2017 Thien-Thi Nguyen
@quotation
Permission is granted to copy, distribute and/or modify this document
@@ -195,7 +195,7 @@ rlog's @option{-N} option. Paul D.@tie{}Smith of Data General
suggested improvements in option and error processing. Adam Hammer
of Purdue QAed.
-Thien-Thi Nguyen is responsibile for RCS 5.8. He modernized the code
+Thien-Thi Nguyen is responsible for RCS 5.8. He modernized the code
base, build system, and manual pages, fixing some bugs on the way. He
added standard @option{--help}, @option{--version} processing, and wrote
the documentation you are reading (gladly taking inspiration from the
@@ -1047,7 +1047,9 @@ of one of the environment variables @code{TMPDIR}, @code{TMP}, or
@defvrx {Environment Variable} USER
Absent @option{-w@var{login}}, or when @var{login} is omitted
(@pxref{Misc common options}), commands check environment variables
-@code{LOGNAME} and @code{USER} (in that order). If neither of these
+@code{LOGNAME} and @code{USER} in that order@footnote{However,
+on systems where env var @code{LOGNAME} is readonly at configure time,
+RCS checks @code{USER} first.}. If neither of these
are set, RCS queries the host for, and uses, your login.
@end defvr
@@ -1168,7 +1170,7 @@ Force overwrite of working file.
@xref{Misc common options}.
@item -p[@var{rev}]
-Write to stdout instead of the working file.
+Write to standard output instead of the working file.
@item -r[@var{rev}]
Normal checkout.
@@ -1292,12 +1294,12 @@ Use @command{diff3} @option{-A}, @option{-E} (default), or @option{-e},
respectively.
@item -p
-Write to stdout instead of overwriting @var{receiving-sibling}.
+Write to standard output instead of overwriting @var{receiving-sibling}.
@item -q
@xref{Misc common options}. Suppress conflict warnings.
-@item -L@var{label}
+@item -L @var{label}
(up to three times) Specify the conflict labels for
@var{receiving-sibling}, @var{parent} and @var{other-sibling},
respectively.
@@ -1555,7 +1557,7 @@ The @code{-A} style generates the most verbose output.
@xref{Invoking diff3,,,diff,The GNU Diffutils Manual}.
@item -p[@var{rev}]
-Write to stdout instead of overwriting the working file.
+Write to standard output instead of overwriting the working file.
@item -q[@var{rev}]
@xref{Misc common options}.
@@ -1662,6 +1664,21 @@ or by the user if @var{who} is omitted.
@item -z@var{zone}
@xref{Date option}.
+This option also changes the output format of the date to use
+hyphens instead of slashes.
+For example:
+
+@example
+$ rlog t,v # @r{without -z}
+...
+date: 2010/10/02 04:35:26; [...]
+...
+
+$ rlog -z+0200 t,v
+...
+date: 2010-10-02 06:35:26+02; [...]
+...
+@end example
@end table
@ineffectual @samp{-q}, @samp{-T}
diff --git rcs-5.9.4.orig/m4/gnulib-cache.m4 rcs-5.9.4/m4/gnulib-cache.m4
index 53e79e9..6a76be5 100644
--- rcs-5.9.4.orig/m4/gnulib-cache.m4
+++ rcs-5.9.4/m4/gnulib-cache.m4
@@ -1,4 +1,4 @@
-# Copyright (C) 2002-2015 Free Software Foundation, Inc.
+# Copyright (C) 2002-2016 Free Software Foundation, Inc.
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -27,7 +27,7 @@
# Specification in the form of a command-line invocation:
-# gnulib-tool --import --dir=. --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files _Exit close closedir dirent double-slash-root errno exitfail extensions fcntl fcntl-h findprog fstat ftruncate getcwd getlogin_r getopt-gnu git-version-gen hash-pjw inline largefile mempcpy mkstemp obstack obstack-printf open opendir progname readdir readlink same-inode sigaction signal signal-h snippet/_Noreturn snippet/arg-nonnull snippet/unused-parameter snprintf sprintf-posix ssize_t stat stdarg stdbool stdint stdio stdlib string strsignal sys_stat sys_types sys_wait time time_r tzset unistd unistd-safer unlink vararrays vla waitpid xalloc
+# gnulib-tool --import --lib=libgnu --source-base=lib --m4-base=m4 --doc-base=doc --tests-base=tests --aux-dir=build-aux --conditional-dependencies --no-libtool --macro-prefix=gl --no-vc-files _Exit close closedir dirent double-slash-root errno exitfail extensions fcntl fcntl-h findprog fstat ftruncate getcwd getlogin_r getopt-gnu git-version-gen hash-pjw inline largefile memchr mempcpy mkstemp obstack obstack-printf open opendir progname readdir readlink same-inode sigaction signal signal-h snippet/_Noreturn snippet/arg-nonnull snippet/unused-parameter snprintf sprintf-posix ssize_t stat stdarg stdbool stdint stdio stdlib string strsignal sys_stat sys_types sys_wait time time_r tzset unistd unistd-safer unlink vararrays vla waitpid xalloc
# Specification in the form of a few gnulib-tool.m4 macro invocations:
gl_LOCAL_DIR([])
@@ -52,6 +52,7 @@ gl_MODULES([
hash-pjw
inline
largefile
+ memchr
mempcpy
mkstemp
obstack
diff --git rcs-5.9.4.orig/man/ChangeLog rcs-5.9.4/man/ChangeLog
index cad4f83..8d08771 100644
--- rcs-5.9.4.orig/man/ChangeLog
+++ rcs-5.9.4/man/ChangeLog
@@ -691,7 +691,7 @@ Wed Aug 2 14:26:46 1989 Paul Eggert <eggert@twinsun.com>
Update DIAGNOSTICS to reflect RCS version 4.
-Copyright (C) 2010-2015 Thien-Thi Nguyen
+Copyright (C) 2010-2017 Thien-Thi Nguyen
Copying and distribution of this file, with or without modification,
are permitted provided the copyright notice and this notice are preserved.
diff --git rcs-5.9.4.orig/man/Makefile.am rcs-5.9.4/man/Makefile.am
index 48ed19e..d98ba27 100644
--- rcs-5.9.4.orig/man/Makefile.am
+++ rcs-5.9.4/man/Makefile.am
@@ -1,6 +1,6 @@
# Make RCS man pages.
-# Copyright (C) 2010-2015 Thien-Thi Nguyen
+# Copyright (C) 2010-2017 Thien-Thi Nguyen
#
# This file is part of GNU RCS.
#
diff --git rcs-5.9.4.orig/man/b-identification rcs-5.9.4/man/b-identification
index 430bfce..6433005 100644
--- rcs-5.9.4.orig/man/b-identification
+++ rcs-5.9.4/man/b-identification
@@ -3,7 +3,7 @@ Author: Walter F. Tichy.
.br
Manual Page Revision: \*(Rv; Release Date: \*(Dt.
.br
-Copyright \(co 2010-2015 Thien-Thi Nguyen.
+Copyright \(co 2010-2017 Thien-Thi Nguyen.
.br
Copyright \(co \*(EY Paul Eggert.
.br
diff --git rcs-5.9.4.orig/src/ChangeLog rcs-5.9.4/src/ChangeLog
index 8eec4a0..c886875 100644
--- rcs-5.9.4.orig/src/ChangeLog
+++ rcs-5.9.4/src/ChangeLog
@@ -1,3 +1,270 @@
+2016-10-31 Thien-Thi Nguyen <ttn@gnu.org>
+
+ [int] Expand exit_diff_trouble to handle complain calls.
+
+ * rcsutil.c (exit_diff_trouble): Take FMT and varargs;
+ call vcomplain w/ them immediately before _Exit.
+ (runv): Fold complain calls preceding calls to
+ exit_diff_trouble into args to exit_diff_trouble.
+
+2016-10-31 Thien-Thi Nguyen <ttn@gnu.org>
+
+ [int] Add abstraction: chk_set_rev
+
+ * rcsutil.c (chk_set_rev): New func.
+ * base.h (chk_set_rev): New func decl.
+ * ci.c (ci_main): Use chk_set_rev.
+ * co.c (co_main): Likewise.
+ * rcsclean.c (rcsclean_main): Likewise.
+
+2016-10-29 Thien-Thi Nguyen <ttn@gnu.org>
+
+ rlog: Fix bug: Handle ed script with embedded NUL.
+
+ Regression introduced 2010-05-24, "Rewrite parsing".
+
+ * rlog.c (count_a_d): Don't use memchr
+ to scan for newline; instead, use memchr.
+
+2016-10-27 Thien-Thi Nguyen <ttn@gnu.org>
+
+ [int] Avoid unnecessary allocation in string_from_atat.
+
+ This is a continuation of 2016-10-25,
+ "Fix stack crash and port to non-VLA".
+
+ * b-fro.c: Don't #include "xalloc.h".
+ (string_from_atat RBEG): New local macro.
+ (string_from_atat): Don't bother constructing an array
+ of ranges; instead, use RBEG and atat->holes directly.
+
+2016-10-27 Thien-Thi Nguyen <ttn@gnu.org>
+
+ Fix bug: Handle time-zone specified sans numeric offset.
+
+ * partime.c (parzone): When only the name is given,
+ and it is valid, set the output offset var using the
+ value associated with the name in the lookup table.
+
+2016-10-26 Paul Eggert <eggert@cs.ucla.edu>
+
+ [int] Fix stack crash for long branches
+
+ This does not fix all recursive calls, just enough to fix
+ likely cases, including the bug report by Haoming Chu at:
+ http://lists.gnu.org/archive/html/bug-rcs/2016-10/msg00002.html
+ * rlog.c (putadelta): Do not check node->selector; now the
+ callers responsibility. Remove arg TRUNK; now inferred from
+ other args. All callers changed.
+ (putadelta, putrunk): Omit register as the compiler should
+ figure this stuff out nowadays.
+ * rcsgen.c (putree):
+ * rlog.c (putree, exttree, recentdate, extdate):
+ Avoid recursion in the common case where !root->branches.
+ * rlog.c (putree): Avoid recursion when outputting the last tree
+ in the forest.
+ (putabranch): Do not check whether arg is null; now the
+ callers responsibility. Avoid recursion in the common case
+ where !root->selector.
+ (putforest): Return last tree in the forest.
+ (extractdelta): Return bool, not char.
+ (extdate): Return size_t, not int. All callers changed.
+
+2016-10-25 Paul Eggert <eggert@cs.ucla.edu>
+
+ [int] Fix stack crash and port to non-VLA
+
+ Crash reported by Michael Watters in:
+ http://lists.gnu.org/archive/html/bug-rcs/2016-10/msg00000.html
+ * b-fro.c: Include xalloc.h.
+ (string_from_atat): Use xnmalloc rather than a variable-length array.
+ VLAs (a) can crash if too big, and (b) are not supported by some C
+ compilers. C11 no longer requires support for VLAs.
+
+2016-10-24 Thien-Thi Nguyen <ttn@gnu.org>
+
+ [int] Incorporate normalize_arg into unique caller.
+
+ * merger.c (normalize_arg): Delete func.
+ (merge): Do argument normalization here.
+
+2016-10-24 Thien-Thi Nguyen <ttn@gnu.org>
+
+ [int] Incorporate escape_string into unique caller.
+
+ * b-kwxout.c (escape_string): Delete func.
+ (afilename): Do escaping here.
+
+2016-10-24 Thien-Thi Nguyen <ttn@gnu.org>
+
+ [int] Make accs into a function.
+
+ * b-divvy.c (accs): New func.
+ * b-divvy.h (accs): Replace macro w/ func decl.
+
+2016-10-21 Thien-Thi Nguyen <ttn@gnu.org>
+
+ [int] Declare ignoble as exiting.
+
+ * b-grok.c (ignoble): ...here.
+
+2016-10-21 Thien-Thi Nguyen <ttn@gnu.org>
+
+ [grok] Fix bug: Detect/diagnose missing string correctly.
+
+ Regression introduced 2010-06-12, "Build atat object incrementally".
+
+ * b-grok.c (maybe_read_atat): After skipping whitespace,
+ if the next char is not SDELIM, don't bother constructing
+ a length-zero atat and return false.
+ (must_read_atat): Change diagnostic to be similar to RCS 5.7.
+
+2016-10-17 Thien-Thi Nguyen <ttn@gnu.org>
+
+ [int] Add abstraction: afilename
+
+ * b-kwxout.c (afilename): New static func.
+ (keyreplace): Use afilename.
+
+2016-10-16 Thien-Thi Nguyen <ttn@gnu.org>
+
+ [int] Make putstring more efficient.
+
+ * rcsgen.c (putstring): Don't loop byte by byte w/ aputc;
+ instead, loop over SDELIM-delimited byte ranges w/ awrite.
+
+2016-10-16 Thien-Thi Nguyen <ttn@gnu.org>
+
+ [int] Simplify putstring.
+
+ * rcsgen.c (putstring): No longer take 2nd arg DELIM;
+ output initial SDELIM unconditionally.
+ (putdesc, putadmin, putdftext): Update putstring calls.
+ * base.h (putstring): Update func decl accordingly.
+ * rcs.c (scanlogtext): Update putstring call.
+
+2016-10-16 Thien-Thi Nguyen <ttn@gnu.org>
+
+ [int] Prepare to simplify putstring.
+
+ * rcsgen.c (putdesc): Don't output SDELIM here;
+ instead, arrange for putstring to do it.
+
+2016-10-15 Thien-Thi Nguyen <ttn@gnu.org>
+
+ [int] Add abstraction: put_SDELIM
+
+ * rcsgen.c (put_SDELIM): New static func.
+ (putstring, putdftext): Use put_SDELIM.
+
+2016-10-15 Thien-Thi Nguyen <ttn@gnu.org>
+
+ [int] Simplify aputc + putstring sequence.
+
+ * rcs.c (scanlogtext): Remove aputc call; change
+ putstring arg DELIM to make it handle the SDELIM output.
+
+2016-10-15 Thien-Thi Nguyen <ttn@gnu.org>
+
+ [int] Add abstraction: newline
+
+ * b-fb.c (newline): New func.
+ * b-fb.h (newline): New func decl.
+ * b-fro.c (atat_display): Use newline.
+ * b-kwxout.c (keyreplace): Likewise.
+ * ci.c (ci_main): Likewise.
+ * rcs.c (scanlogtext): Likewise.
+ * rcsgen.c (putdesc, putstring, putdftext): Likewise.
+ * rlog.c (putadelta, rlog_main): Likewise.
+
+2016-10-13 Thien-Thi Nguyen <ttn@gnu.org>
+
+ [doc] Fix bug: Add space between merge option -L and its arg.
+
+ * merge.c (:help comment): ...here.
+
+2016-10-13 Thien-Thi Nguyen <ttn@gnu.org>
+
+ [int] Simplify computation of obstack mask alignment.
+
+ * b-divvy.c (make_space): For width, replace assignment
+ plus conditional reassignment w/ single ?: expression.
+
+2015-06-18 Thien-Thi Nguyen <ttn@gnu.org>
+
+ [C slog] Move exiting to beginning of func decl.
+
+ Apparently, gcc --std=c11 does not abide the exiting
+ attribute appearing at the end of the func decl.
+ Reported by Romain Francoise.
+ See also <https://bugs.debian.org/778100>.
+
+ * b-complain.h (generic_fatal, fatal_syntax, fatal_sys)
+ * b-fb.h (Ierror, Oerror)
+ * base.h (unexpected_EOF, thank_you_and_goodnight):
+ Move exiting attribute to beginning of func decl.
+
+2015-02-19 Thien-Thi Nguyen <ttn@gnu.org>
+
+ [int] Add abstraction: accumulate_nbytes
+
+ * b-divvy.c (accumulate_nbytes): New func.
+ * b-divvy.h (accumulate_nbytes): New func decl.
+ * b-fro.c (string_from_sym): Use accumulate_nbytes.
+ * ci.c (ADD): Likewise.
+ * rcsfnms.c (fin2open ACC): Likewise.
+
+2015-02-18 Thien-Thi Nguyen <ttn@gnu.org>
+
+ [int] Centralize "possible-endings" defaulting.
+
+ * rcsutil.c (gnurcs_init): Init BE (pe) here.
+ * ci.c (ci_main): Don't init BE (pe).
+ * co.c (co_main): Likewise.
+ * rcs.c (rcs_main): Likewise.
+ * rcsclean.c (rcsclean_main): Likewise.
+ * rcsdiff.c (rcsdiff_main): Likewise.
+ * rcsmerge.c (rcsmerge_main): Likewise.
+ * rlog.c (rlog_main): Likewise.
+ * base.h (X_DEFAULT): Delete #define.
+
+2015-02-02 Thien-Thi Nguyen <ttn@gnu.org>
+
+ [slog] Consult USER before LOGNAME if latter is configure-time readonly.
+
+ * b-excwho.c (CONSULT_FIRST, CONSULT_SECOND):
+ New #define:s, bifurcated on USER_OVER_LOGNAME.
+ (getusername): Use CONSULT_FIRST, CONSULT_SECOND.
+
+2015-01-28 Thien-Thi Nguyen <ttn@gnu.org>
+
+ [C int] Use local var to avoid gcc warning.
+
+ * b-isr.c (access_page): Change return type to char; return t.
+ * b-isr.h (access_page): Update func decl.
+
+2015-01-27 Thien-Thi Nguyen <ttn@gnu.org>
+
+ [build slog] Fix bug: Propagate makefile var LIBTHREAD.
+
+ Omission since 5.8, or so. Gnulib module threadlib includes
+ configure-script bits to set makefile var LIBTHREAD. RCS has no
+ concept of threads and does not specify threadlib directly; it is a
+ dependency of other Gnulib modules. Reported by Michael Felt:
+ <http://lists.gnu.org/archive/html/bug-rcs/2015-01/msg00004.html>.
+
+ * Makefile.am (LDADD): Append $(LIBTHREAD), as well.
+
+2015-01-24 Thien-Thi Nguyen <ttn@gnu.org>
+
+ [C slog] Add abstraction: BOOLEAN
+
+ This silences a warning under AIX. Reported by Michael Felt:
+ <http://lists.gnu.org/archive/html/bug-rcs/2015-01/msg00007.html>.
+
+ * base.h (BOOLEAN): New macro.
+ * b-grok.c (maybe_read_atat): Use it.
+
2015-01-22 Thien-Thi Nguyen <ttn@gnu.org>
Release: 5.9.4
@@ -9365,7 +9632,7 @@ Thu May 6 11:38:00 1982 Walter F. Tichy <wft@purdue>
* maketime.c, partime.c: Initial revision
-Copyright (C) 2010-2015 Thien-Thi Nguyen
+Copyright (C) 2010-2017 Thien-Thi Nguyen
Copying and distribution of this file, with or without modification,
are permitted provided the copyright notice and this notice are preserved.
diff --git rcs-5.9.4.orig/src/Makefile.am rcs-5.9.4/src/Makefile.am
index 4e10d84..6bbb18a 100644
--- rcs-5.9.4.orig/src/Makefile.am
+++ rcs-5.9.4/src/Makefile.am
@@ -1,6 +1,6 @@
# Make RCS.
-# Copyright (C) 2010-2015 Thien-Thi Nguyen
+# Copyright (C) 2010-2017 Thien-Thi Nguyen
#
# This file is part of GNU RCS.
#
@@ -51,6 +51,9 @@ rcs_SOURCES = rcs.c $(subs:=.c) super.c
LDADD = libparts.a -L$(top_builddir)/lib -lgnu
+## This is segregated in case we want to conditionalize, later.
+LDADD += $(LIBTHREAD)
+
CLEANFILES = $(BUILT_SOURCES) $(subs)
EXTRA_DIST = sub.TEMPLATE
diff --git rcs-5.9.4.orig/src/b-anchor.c rcs-5.9.4/src/b-anchor.c
index 2fd61b8..39bbebf 100644
--- rcs-5.9.4.orig/src/b-anchor.c
+++ rcs-5.9.4/src/b-anchor.c
@@ -1,6 +1,6 @@
/* b-anchor.c --- constant data and their lookup funcs
- Copyright (C) 2010-2015 Thien-Thi Nguyen
+ Copyright (C) 2010-2017 Thien-Thi Nguyen
This file is part of GNU RCS.
diff --git rcs-5.9.4.orig/src/b-complain.c rcs-5.9.4/src/b-complain.c
index d9791a7..9305d6e 100644
--- rcs-5.9.4.orig/src/b-complain.c
+++ rcs-5.9.4/src/b-complain.c
@@ -1,6 +1,6 @@
/* b-complain.c --- various ways of writing to standard error
- Copyright (C) 2010-2015 Thien-Thi Nguyen
+ Copyright (C) 2010-2017 Thien-Thi Nguyen
This file is part of GNU RCS.
diff --git rcs-5.9.4.orig/src/b-complain.h rcs-5.9.4/src/b-complain.h
index 0ffd157..40e6ea9 100644
--- rcs-5.9.4.orig/src/b-complain.h
+++ rcs-5.9.4/src/b-complain.h
@@ -1,6 +1,6 @@
/* b-complain.h --- various ways of writing to standard error
- Copyright (C) 2010-2015 Thien-Thi Nguyen
+ Copyright (C) 2010-2017 Thien-Thi Nguyen
This file is part of GNU RCS.
@@ -32,12 +32,14 @@ extern void generic_warn (char const *who, char const *fmt, ...)
printf_string (2, 3);
extern void generic_error (char const *who, char const *fmt, ...)
printf_string (2, 3);
+exiting
extern void generic_fatal (char const *who, char const *fmt, ...)
- printf_string (2, 3) exiting;
+ printf_string (2, 3);
+exiting
extern void fatal_syntax (size_t lno, char const *fmt, ...)
- printf_string (2, 3) exiting;
-extern void fatal_sys (char const *who)
- exiting;
+ printf_string (2, 3);
+exiting
+extern void fatal_sys (char const *who);
/* Idioms. Here, prefix P stands for "program" (general operation);
M for "manifestation"; R for "repository". */
diff --git rcs-5.9.4.orig/src/b-divvy.c rcs-5.9.4/src/b-divvy.c
index 5dcfec3..d3c64f5 100644
--- rcs-5.9.4.orig/src/b-divvy.c
+++ rcs-5.9.4/src/b-divvy.c
@@ -1,6 +1,6 @@
/* b-divvy.c --- dynamic memory manglement
- Copyright (C) 2010-2015 Thien-Thi Nguyen
+ Copyright (C) 2010-2017 Thien-Thi Nguyen
This file is part of GNU RCS.
@@ -46,10 +46,10 @@ make_space (char const name[])
/* Set alignment to avoid segfault (on some hosts).
The downside is wasted space on less-sensitive hosts. */
{
- size_t widest = sizeof (off_t);
+ size_t widest = (sizeof (void *) > sizeof (off_t))
+ ? sizeof (void *)
+ : sizeof (off_t);
- if (widest < sizeof (void *))
- widest = sizeof (void *);
obstack_alignment_mask (&divvy->space) = widest - 1;
}
@@ -131,6 +131,12 @@ accf (struct divvy *divvy, char const *fmt, ...)
}
void
+accumulate_nbytes (struct divvy *divvy, char const *start, size_t count)
+{
+ obstack_grow (&divvy->space, start, count);
+}
+
+void
accumulate_byte (struct divvy *divvy, int c)
{
obstack_1grow (&divvy->space, c);
@@ -142,6 +148,12 @@ accumulate_range (struct divvy *divvy, char const *beg, char const *end)
obstack_grow (&divvy->space, beg, end - beg);
}
+void
+accs (struct divvy *divvy, char const *string)
+{
+ obstack_grow (&divvy->space, string, strlen (string));
+}
+
char *
finish_string (struct divvy *divvy, size_t *result_len)
{
diff --git rcs-5.9.4.orig/src/b-divvy.h rcs-5.9.4/src/b-divvy.h
index 7a0db08..7abfbdb 100644
--- rcs-5.9.4.orig/src/b-divvy.h
+++ rcs-5.9.4/src/b-divvy.h
@@ -1,6 +1,6 @@
/* b-divvy.h --- dynamic memory manglement
- Copyright (C) 2010-2015 Thien-Thi Nguyen
+ Copyright (C) 2010-2017 Thien-Thi Nguyen
This file is part of GNU RCS.
@@ -38,9 +38,12 @@ extern char *intern (struct divvy *divvy, char const *s, size_t len);
extern void brush_off (struct divvy *divvy, void *ptr);
extern void forget (struct divvy *divvy);
extern void accf (struct divvy *divvy, char const *fmt, ...);
+extern void accumulate_nbytes (struct divvy *divvy,
+ char const *start, size_t count);
extern void accumulate_byte (struct divvy *divvy, int c);
extern void accumulate_range (struct divvy *divvy,
char const *beg, char const *end);
+extern void accs (struct divvy *divvy, char const *string);
extern char *finish_string (struct divvy *divvy, size_t *result_len);
extern void *pointer_array (struct divvy *divvy, size_t count);
extern void close_space (struct divvy *divvy);
@@ -53,7 +56,6 @@ extern void close_space (struct divvy *divvy);
#define ZLLOC(n,type) (zlloc (PLEXUS, #type, sizeof (type) * n))
#define FALLOC(type) (alloc (SINGLE, #type, sizeof (type)))
#define FZLLOC(type) (zlloc (SINGLE, #type, sizeof (type)))
-#define accs(divvy,string) accf (divvy, "%s", string)
#define SHACCR(b,e) accumulate_range (PLEXUS, b, e)
#define SHSTR(szp) finish_string (PLEXUS, szp)
diff --git rcs-5.9.4.orig/src/b-esds.c rcs-5.9.4/src/b-esds.c
index 7168843..4e86116 100644
--- rcs-5.9.4.orig/src/b-esds.c
+++ rcs-5.9.4/src/b-esds.c
@@ -1,6 +1,6 @@
/* b-esds.c --- embarrassingly simple data structures
- Copyright (C) 2010-2015 Thien-Thi Nguyen
+ Copyright (C) 2010-2017 Thien-Thi Nguyen
This file is part of GNU RCS.
diff --git rcs-5.9.4.orig/src/b-esds.h rcs-5.9.4/src/b-esds.h
index 683ade8..538fb14 100644
--- rcs-5.9.4.orig/src/b-esds.h
+++ rcs-5.9.4/src/b-esds.h
@@ -1,6 +1,6 @@
/* b-esds.h --- embarrassingly simple data structures
- Copyright (C) 2010-2015 Thien-Thi Nguyen
+ Copyright (C) 2010-2017 Thien-Thi Nguyen
This file is part of GNU RCS.
diff --git rcs-5.9.4.orig/src/b-excwho.c rcs-5.9.4/src/b-excwho.c
index 96524d0..a0c9c30 100644
--- rcs-5.9.4.orig/src/b-excwho.c
+++ rcs-5.9.4/src/b-excwho.c
@@ -1,6 +1,6 @@
/* b-excwho.c --- exclusivity / identity
- Copyright (C) 2010-2015 Thien-Thi Nguyen
+ Copyright (C) 2010-2017 Thien-Thi Nguyen
Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Paul Eggert
Copyright (C) 1982, 1988, 1989 Walter Tichy
@@ -157,6 +157,14 @@ setrid (void)
#endif
}
+#if USER_OVER_LOGNAME
+#define CONSULT_FIRST "USER"
+#define CONSULT_SECOND "LOGNAME"
+#else
+#define CONSULT_FIRST "LOGNAME"
+#define CONSULT_SECOND "USER"
+#endif
+
char const *
getusername (bool suspicious)
/* Get and return the caller's login name.
@@ -169,8 +177,8 @@ getusername (bool suspicious)
/* Prefer getenv unless suspicious; it's much faster. */
if (suspicious
- || (!JAM (cgetenv ("LOGNAME"))
- && !JAM (cgetenv ("USER"))
+ || (!JAM (cgetenv (CONSULT_FIRST))
+ && !JAM (cgetenv (CONSULT_SECOND))
&& !(0 == getlogin_r (buf, BUFSIZ)
&& JAM (str_save (buf)))))
{
diff --git rcs-5.9.4.orig/src/b-excwho.h rcs-5.9.4/src/b-excwho.h
index d03177c..0fbdae2 100644
--- rcs-5.9.4.orig/src/b-excwho.h
+++ rcs-5.9.4/src/b-excwho.h
@@ -1,6 +1,6 @@
/* b-excwho.h --- exclusivity / identity
- Copyright (C) 2010-2015 Thien-Thi Nguyen
+ Copyright (C) 2010-2017 Thien-Thi Nguyen
Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Paul Eggert
Copyright (C) 1982, 1988, 1989 Walter Tichy
diff --git rcs-5.9.4.orig/src/b-fb.c rcs-5.9.4/src/b-fb.c
index 49510d7..0cc316a 100644
--- rcs-5.9.4.orig/src/b-fb.c
+++ rcs-5.9.4/src/b-fb.c
@@ -1,6 +1,6 @@
/* b-fb.c --- basic file operations
- Copyright (C) 2010-2015 Thien-Thi Nguyen
+ Copyright (C) 2010-2017 Thien-Thi Nguyen
Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Paul Eggert
Copyright (C) 1982, 1988, 1989 Walter Tichy
@@ -137,6 +137,13 @@ afputc (int c, register FILE *f)
}
void
+newline (FILE *f)
+/* Write a newline character (U+0A) to f; abort on error. */
+{
+ aputc ('\n', f);
+}
+
+void
aputs (char const *s, FILE *iop)
/* Put string s on file iop, abort on error. */
{
diff --git rcs-5.9.4.orig/src/b-fb.h rcs-5.9.4/src/b-fb.h
index c9850e7..b8e1da6 100644
--- rcs-5.9.4.orig/src/b-fb.h
+++ rcs-5.9.4/src/b-fb.h
@@ -1,6 +1,6 @@
/* b-fb.h --- basic file operations
- Copyright (C) 2010-2015 Thien-Thi Nguyen
+ Copyright (C) 2010-2017 Thien-Thi Nguyen
Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Paul Eggert
Copyright (C) 1982, 1988, 1989 Walter Tichy
@@ -21,15 +21,18 @@
*/
extern int change_mode (int fd, mode_t mode);
-extern void Ierror (void) exiting;
+exiting
+extern void Ierror (void);
extern void testIerror (FILE *f);
-extern void Oerror (void) exiting;
+exiting
+extern void Oerror (void);
extern void testOerror (FILE *o);
extern FILE *fopen_safer (char const *filename, char const *type);
extern void Ozclose (FILE **p);
extern void aflush (FILE *f);
extern void oflush (void);
extern void afputc (int c, FILE *f);
+extern void newline (FILE *f);
extern void aputs (char const *s, FILE *iop);
extern void aprintf (FILE *iop, char const *fmt, ...)
printf_string (2, 3);
diff --git rcs-5.9.4.orig/src/b-feph.c rcs-5.9.4/src/b-feph.c
index 8613904..70dd87b 100644
--- rcs-5.9.4.orig/src/b-feph.c
+++ rcs-5.9.4/src/b-feph.c
@@ -1,6 +1,6 @@
/* b-feph.c --- (possibly) temporary files
- Copyright (C) 2010-2015 Thien-Thi Nguyen
+ Copyright (C) 2010-2017 Thien-Thi Nguyen
Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Paul Eggert
Copyright (C) 1982, 1988, 1989 Walter Tichy
diff --git rcs-5.9.4.orig/src/b-feph.h rcs-5.9.4/src/b-feph.h
index 5d9429c..a9016df 100644
--- rcs-5.9.4.orig/src/b-feph.h
+++ rcs-5.9.4/src/b-feph.h
@@ -1,6 +1,6 @@
/* b-feph.h --- (possibly) temporary files
- Copyright (C) 2010-2015 Thien-Thi Nguyen
+ Copyright (C) 2010-2017 Thien-Thi Nguyen
Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Paul Eggert
Copyright (C) 1982, 1988, 1989 Walter Tichy
diff --git rcs-5.9.4.orig/src/b-fro.c rcs-5.9.4/src/b-fro.c
index 546c50c..1335e27 100644
--- rcs-5.9.4.orig/src/b-fro.c
+++ rcs-5.9.4/src/b-fro.c
@@ -1,6 +1,6 @@
/* b-fro.c --- read-only file
- Copyright (C) 2010-2015 Thien-Thi Nguyen
+ Copyright (C) 2010-2017 Thien-Thi Nguyen
Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Paul Eggert
Copyright (C) 1982, 1988, 1989 Walter Tichy
@@ -381,31 +381,28 @@ string_from_atat (struct divvy *space, struct atat const *atat)
{
struct fro *f = atat->from;
size_t count = atat->count;
- struct range r[count];
struct cbuf cb;
size_t i;
- for (i = 0; i < count; i++)
- {
- r[i].beg = 1 + (i ? atat->holes[i - 1] : atat->beg);
- r[i].end = atat->holes[i];
- }
+#define RBEG(i) (1 + (i ? atat->holes[i - 1] : atat->beg))
+
switch (f->rm)
{
case RM_MMAP:
case RM_MEM:
for (i = 0; i < count; i++)
{
- char const *beg = f->base + r[i].beg;
- off_t len = r[i].end - r[i].beg;
+ off_t rbeg = RBEG (i);
+ char const *beg = f->base + rbeg;
+ off_t len = atat->holes[i] - rbeg;
while (SSIZE_MAX < len)
{
- accumulate_range (space, beg, beg + SSIZE_MAX);
+ accumulate_nbytes (space, beg, SSIZE_MAX);
len -= SSIZE_MAX;
beg += SSIZE_MAX;
}
- accumulate_range (space, beg, beg + len);
+ accumulate_nbytes (space, beg, len);
}
break;
case RM_STDIO:
@@ -415,10 +412,10 @@ string_from_atat (struct divvy *space, struct atat const *atat)
for (i = 0; i < count; i++)
{
- off_t pos = r[i].beg;
+ off_t pos = RBEG (i);
fseeko (stream, pos, SEEK_SET);
- while (pos++ < r[i].end)
+ while (pos++ < atat->holes[i])
accumulate_byte (space, getc (f->stream));
}
fseeko (stream, was, SEEK_SET);
@@ -427,6 +424,8 @@ string_from_atat (struct divvy *space, struct atat const *atat)
}
cb.string = finish_string (space, &cb.size);
return cb;
+
+#undef RBEG
}
void
@@ -486,7 +485,7 @@ atat_display (FILE *to, struct atat const *atat, bool ensure_newline_p)
}
if ('\n' != lc)
- aputc ('\n', to);
+ newline (to);
}
}
diff --git rcs-5.9.4.orig/src/b-fro.h rcs-5.9.4/src/b-fro.h
index 797240c..0f36fe3 100644
--- rcs-5.9.4.orig/src/b-fro.h
+++ rcs-5.9.4/src/b-fro.h
@@ -1,6 +1,6 @@
/* b-fro.h --- read-only file
- Copyright (C) 2010-2015 Thien-Thi Nguyen
+ Copyright (C) 2010-2017 Thien-Thi Nguyen
Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Paul Eggert
Copyright (C) 1982, 1988, 1989 Walter Tichy
diff --git rcs-5.9.4.orig/src/b-grok.c rcs-5.9.4/src/b-grok.c
index c6a2e88..600a3eb 100644
--- rcs-5.9.4.orig/src/b-grok.c
+++ rcs-5.9.4/src/b-grok.c
@@ -1,6 +1,6 @@
/* b-grok.c --- comma-v parsing
- Copyright (C) 2010-2015 Thien-Thi Nguyen
+ Copyright (C) 2010-2017 Thien-Thi Nguyen
This file is part of GNU RCS.
@@ -94,6 +94,7 @@ pop_context (struct grok *g)
#endif
+exiting
static void
ignoble (struct grok *g, char const *fmt, ...)
{
@@ -335,7 +336,7 @@ atat_ineedexp_few (struct atat *atat, size_t i)
static bool
maybe_read_atat (struct grok *g, struct atat **res)
{
- struct atat *atat;
+ struct atat *atat = NULL;
off_t beg;
size_t lno_start;
bool newlinep = false;
@@ -344,6 +345,12 @@ maybe_read_atat (struct grok *g, struct atat **res)
CBEG ("atat");
skip_whitespace (g);
+
+ /* Don't bother constructing an empty (length zero) atat
+ if there is nothing to do. */
+ if (SDELIM != g->c)
+ goto done;
+
lno_start = g->lno;
beg = POS (-1);
start_atat (g->systolic, true);
@@ -407,15 +414,16 @@ maybe_read_atat (struct grok *g, struct atat **res)
+ count * sizeof (off_t)));
}
+ done:
CEND ();
- return atat;
+ return BOOLEAN (atat);
}
static void
must_read_atat (struct grok *g, struct atat **res, char const *role)
{
if (! maybe_read_atat (g, res))
- BUMMER ("missing %s", role);
+ BUMMER ("missing string after %s", role);
}
#define MUST_ATAT(g,res,kw) must_read_atat (g, res, TINYKS (kw))
diff --git rcs-5.9.4.orig/src/b-grok.h rcs-5.9.4/src/b-grok.h
index 7847fc6..7df1a21 100644
--- rcs-5.9.4.orig/src/b-grok.h
+++ rcs-5.9.4/src/b-grok.h
@@ -1,6 +1,6 @@
/* b-grok.h --- comma-v parsing
- Copyright (C) 2010-2015 Thien-Thi Nguyen
+ Copyright (C) 2010-2017 Thien-Thi Nguyen
This file is part of GNU RCS.
diff --git rcs-5.9.4.orig/src/b-isr.c rcs-5.9.4/src/b-isr.c
index 52c3a6f..d07774b 100644
--- rcs-5.9.4.orig/src/b-isr.c
+++ rcs-5.9.4/src/b-isr.c
@@ -1,6 +1,6 @@
/* b-isr.c --- interrupt service routine
- Copyright (C) 2010-2015 Thien-Thi Nguyen
+ Copyright (C) 2010-2017 Thien-Thi Nguyen
Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Paul Eggert
Copyright (C) 1982, 1988, 1989 Walter Tichy
@@ -83,7 +83,7 @@ struct isr_scratch
#define ISR(x) (scratch->x)
-void
+char
access_page (struct isr_scratch *scratch,
char const *filename, char const *p)
{
@@ -92,6 +92,9 @@ access_page (struct isr_scratch *scratch,
ISR (access_name) = filename;
t = *p;
ISR (access_name) = NULL;
+ /* Give the compiler (specifically: "gcc -Wunused-but-set-variable")
+ one less reason to complain. */
+ return t;
}
static void
diff --git rcs-5.9.4.orig/src/b-isr.h rcs-5.9.4/src/b-isr.h
index 35734f0..1f2575d 100644
--- rcs-5.9.4.orig/src/b-isr.h
+++ rcs-5.9.4/src/b-isr.h
@@ -1,6 +1,6 @@
/* b-isr.h --- interrupt service routine
- Copyright (C) 2010-2015 Thien-Thi Nguyen
+ Copyright (C) 2010-2017 Thien-Thi Nguyen
Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Paul Eggert
Copyright (C) 1982, 1988, 1989 Walter Tichy
@@ -35,7 +35,7 @@ enum isr_actions
};
extern struct isr_scratch *isr_init (bool *be_quiet);
-extern void access_page (struct isr_scratch *scratch,
+extern char access_page (struct isr_scratch *scratch,
char const *filename,
char const *p);
extern void isr_do (struct isr_scratch *scratch,
diff --git rcs-5.9.4.orig/src/b-kwxout.c rcs-5.9.4/src/b-kwxout.c
index 4805c89..d97fcfd 100644
--- rcs-5.9.4.orig/src/b-kwxout.c
+++ rcs-5.9.4/src/b-kwxout.c
@@ -1,6 +1,6 @@
/* b-kwxout.c --- keyword expansion on output
- Copyright (C) 2010-2015 Thien-Thi Nguyen
+ Copyright (C) 2010-2017 Thien-Thi Nguyen
Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Paul Eggert
Copyright (C) 1982, 1988, 1989 Walter Tichy
@@ -29,29 +29,23 @@
#include "b-kwxout.h"
static void
-escape_string (register FILE *out, register char const *s)
-/* Output to out the string s,
- escaping chars that would break ci -k. */
+afilename (bool base, FILE *out)
+/* Output to out either the full comma-v filename (base false)
+ or only its basename (base true). In the process, escape
+ chars that would break ci -k. */
{
- register char c;
+ char const *filename = base
+ ? basefilename (REPO (filename))
+ : getfullRCSname ();
+ char c;
- for (;;)
- switch ((c = *s++))
+ while ((c = *filename++))
+ switch (c)
{
- case 0:
- return;
- case '\t':
- aputs ("\\t", out);
- break;
- case '\n':
- aputs ("\\n", out);
- break;
- case ' ':
- aputs ("\\040", out);
- break;
- case KDELIM:
- aputs ("\\044", out);
- break;
+ case '\t': aputs ("\\t", out); break;
+ case '\n': aputs ("\\n", out); break;
+ case ' ': aputs ("\\040", out); break;
+ case KDELIM: aputs ("\\044", out); break;
case '\\':
if (VERSION (5) <= BE (version))
{
@@ -105,9 +99,7 @@ keyreplace (struct pool_found *marker, struct expctx *ctx)
break;
case Id:
case Header:
- escape_string (out,
- marker->i == Id || RCSv < VERSION (4)
- ? basefilename (REPO (filename)) : getfullRCSname ());
+ afilename (marker->i == Id || RCSv < VERSION (4), out);
aprintf (out, " %s %s %s %s",
delta->num,
date2str (date, datebuf),
@@ -132,7 +124,7 @@ keyreplace (struct pool_found *marker, struct expctx *ctx)
break;
case Log:
case RCSfile:
- escape_string (out, basefilename (REPO (filename)));
+ afilename (true, out);
break;
case Name:
if (delta->name)
@@ -142,7 +134,7 @@ keyreplace (struct pool_found *marker, struct expctx *ctx)
aputs (delta->num, out);
break;
case Source:
- escape_string (out, getfullRCSname ());
+ afilename (false, out);
break;
case State:
aputs (delta->state, out);
@@ -248,7 +240,7 @@ keyreplace (struct pool_found *marker, struct expctx *ctx)
GETCHAR (c, infile);
while (c != KDELIM);
}
- afputc ('\n', out);
+ newline (out);
awrite (cp, cs, out);
sp1 = date2str (date, datebuf);
if (VERSION (5) <= RCSv)
@@ -271,7 +263,7 @@ keyreplace (struct pool_found *marker, struct expctx *ctx)
continue;
for (;;)
{
- afputc ('\n', out);
+ newline (out);
awrite (cp, cw, out);
if (!ls)
break;
diff --git rcs-5.9.4.orig/src/b-kwxout.h rcs-5.9.4/src/b-kwxout.h
index 581d8a8..da99d5d 100644
--- rcs-5.9.4.orig/src/b-kwxout.h
+++ rcs-5.9.4/src/b-kwxout.h
@@ -1,6 +1,6 @@
/* b-kwxout.h --- keyword expansion on output
- Copyright (C) 2010-2015 Thien-Thi Nguyen
+ Copyright (C) 2010-2017 Thien-Thi Nguyen
This file is part of GNU RCS.
diff --git rcs-5.9.4.orig/src/b-merger.h rcs-5.9.4/src/b-merger.h
index a4e1f75..8ee0cd8 100644
--- rcs-5.9.4.orig/src/b-merger.h
+++ rcs-5.9.4/src/b-merger.h
@@ -1,6 +1,6 @@
/* b-merger.h --- merging subsystem
- Copyright (C) 2010-2015 Thien-Thi Nguyen
+ Copyright (C) 2010-2017 Thien-Thi Nguyen
This file is part of GNU RCS.
diff --git rcs-5.9.4.orig/src/b-peer.c rcs-5.9.4/src/b-peer.c
index e95d131..b8f3f6e 100644
--- rcs-5.9.4.orig/src/b-peer.c
+++ rcs-5.9.4/src/b-peer.c
@@ -1,6 +1,6 @@
/* b-peer.c --- finding the execvable name of a peer program
- Copyright (C) 2010-2015 Thien-Thi Nguyen
+ Copyright (C) 2010-2017 Thien-Thi Nguyen
This file is part of GNU RCS.
diff --git rcs-5.9.4.orig/src/b-peer.h rcs-5.9.4/src/b-peer.h
index c8a7605..29cc41f 100644
--- rcs-5.9.4.orig/src/b-peer.h
+++ rcs-5.9.4/src/b-peer.h
@@ -1,6 +1,6 @@
/* b-peer.h --- finding the execvable name of a peer program
- Copyright (C) 2010-2015 Thien-Thi Nguyen
+ Copyright (C) 2010-2017 Thien-Thi Nguyen
This file is part of GNU RCS.
diff --git rcs-5.9.4.orig/src/b-yacmd.h rcs-5.9.4/src/b-yacmd.h
index db62d1f..1bdb7fa 100644
--- rcs-5.9.4.orig/src/b-yacmd.h
+++ rcs-5.9.4/src/b-yacmd.h
@@ -1,6 +1,6 @@
/* b-yacmd.h --- yet another command
- Copyright (C) 2013-2015 Thien-Thi Nguyen
+ Copyright (C) 2013-2017 Thien-Thi Nguyen
This file is part of GNU RCS.
diff --git rcs-5.9.4.orig/src/base.h rcs-5.9.4/src/base.h
index 4946943..50a92bd 100644
--- rcs-5.9.4.orig/src/base.h
+++ rcs-5.9.4/src/base.h
@@ -1,6 +1,6 @@
/* RCS common definitions and data structures
- Copyright (C) 2010-2015 Thien-Thi Nguyen
+ Copyright (C) 2010-2017 Thien-Thi Nguyen
Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Paul Eggert
Copyright (C) 1982, 1988, 1989 Walter Tichy
@@ -43,6 +43,11 @@
#define exiting _Noreturn
+/* Some compilers, notably:
+ - IBM XL C/C++ for AIX, V11.1 (5724-X13), Version: 11.01.0000.0019
+ don't like implicitly considering non-NULL pointers as true. */
+#define BOOLEAN(x) ((x) ? true : false)
+
/* GCC attributes */
#define ARG_NONNULL(which) _GL_ARG_NONNULL (which)
@@ -112,20 +117,17 @@ enum kwsub
SLASH char Principal filename separator.
SLASHes case SLASHes: Labels all filename separators.
ABSFNAME(p) expression Is p an absolute filename?
- X_DEFAULT string Default value for -x option.
*/
#if !WOE
#define TMPDIR "/tmp"
#define SLASH '/'
#define SLASHes '/'
#define ABSFNAME(p) (isSLASH ((p)[0]))
-#define X_DEFAULT ",v"
#else /* WOE */
#define TMPDIR "\\tmp"
#define SLASH "'\\'"
#define SLASHes '\\': case '/': case ':'
#define ABSFNAME(p) (isSLASH ((p)[0]) || (p)[0] && (p)[1] == ':')
-#define X_DEFAULT "\\,v"
#endif
/* Must TZ be set for gmtime_r to work? */
@@ -483,7 +485,6 @@ struct behavior
char const *pe;
/* Possible endings, a slash-separated list of filename-end
fragments to consider for recognizing the name of the RCS file.
- FIXME: Push defaulting into library.
-- [ci]main [co]main [rcs]main [rcsclean]main [rcsdiff]main
-- rcssuffix
-- [rcsmerge]main [rlog]main */
@@ -754,8 +755,8 @@ int dorewrite (bool lockflag, int changed);
int donerewrite (int changed, time_t newRCStime);
void ORCSclose (void);
void ORCSerror (void);
-void unexpected_EOF (void)
- exiting;
+exiting
+void unexpected_EOF (void);
void initdiffcmd (struct diffcmd *dc);
int getdiffcmd (struct fro *finfile, bool delimiter,
FILE *foutfile, struct diffcmd *dc);
@@ -791,7 +792,7 @@ void putadmin (void);
void puttree (struct delta const *root, FILE *fout);
bool putdtext (struct delta const *delta, char const *srcname,
FILE *fout, bool diffmt);
-void putstring (FILE *out, bool delim, struct cbuf s, bool log);
+void putstring (FILE *out, struct cbuf s, bool log);
void putdftext (struct delta const *delta, struct fro *finfile,
FILE *foutfile, bool diffmt);
@@ -830,8 +831,8 @@ char const *date2str (char const date[datesize],
char datebuf[datesize + zonelenmax]);
/* rcsutil */
-void thank_you_and_goodnight (int const how)
- exiting;
+exiting
+void thank_you_and_goodnight (int const how);
/* These are for thank_you_and_goodnight. */
#define TYAG_ORCSERROR (1 << 3)
#define TYAG_DIRTMPUNLINK (1 << 2)
@@ -843,6 +844,7 @@ void gnurcs_init (struct program const *program);
void gnurcs_goodbye (void);
void bad_option (char const *option);
void redefined (int c);
+void chk_set_rev (const char **rev, char *arg);
struct cbuf minus_p (char const *xrev, char const *rev);
void parse_revpairs (char option, char *arg, void *data,
void (*put) (char const *b, char const *e,
diff --git rcs-5.9.4.orig/src/ci.c rcs-5.9.4/src/ci.c
index 8a1cd8e..e7ce942 100644
--- rcs-5.9.4.orig/src/ci.c
+++ rcs-5.9.4/src/ci.c
@@ -1,6 +1,6 @@
/* Check in revisions of RCS files from working files.
- Copyright (C) 2010-2015 Thien-Thi Nguyen
+ Copyright (C) 2010-2017 Thien-Thi Nguyen
Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Paul Eggert
Copyright (C) 1982, 1988, 1989 Walter Tichy
@@ -79,7 +79,14 @@ cleanup (int *exitstatus, struct work *work)
#define OK(x) (x)->string = finish_string (PLEXUS, &((x)->size))
#define JAM(x,s) do { ACCF ("%s", s); OK (x); } while (0)
-#define ADD(x,s) do { ACCF ("%s", (x)->string); JAM (x, s); } while (0)
+
+#define ADD(x,s) do \
+ { \
+ accumulate_nbytes \
+ (PLEXUS, (x)->string, (x)->size); \
+ JAM (x, s); \
+ } \
+ while (0)
static void
incnum (char const *onum, struct cbuf *nnum)
@@ -651,7 +658,6 @@ ci_main (const char *cmd, int argc, char **argv)
Ttimeflag = false;
altdate[0] = '\0'; /* empty alternate date for -d */
usestatdate = false;
- BE (pe) = X_DEFAULT;
argc = getRCSINIT (argc, argv, &newargv);
argv = newargv;
@@ -669,12 +675,7 @@ ci_main (const char *cmd, int argc, char **argv)
case 'l':
keepworkingfile = lockflag = true;
revno:
- if (*a)
- {
- if (rev)
- PWARN ("redefinition of %s", ks_revno);
- rev = a;
- }
+ chk_set_rev (&rev, a);
break;
case 'u':
@@ -1062,7 +1063,7 @@ ci_main (const char *cmd, int argc, char **argv)
while (ftello (frew) < hwm)
/* White out any earlier mistake with '\n's.
This is unlikely. */
- afputc ('\n', frew);
+ newline (frew);
}
}
else
diff --git rcs-5.9.4.orig/src/co.c rcs-5.9.4/src/co.c
index 6518485..cbcfdc6 100644
--- rcs-5.9.4.orig/src/co.c
+++ rcs-5.9.4/src/co.c
@@ -1,6 +1,6 @@
/* Check out working files from revisions of RCS files.
- Copyright (C) 2010-2015 Thien-Thi Nguyen
+ Copyright (C) 2010-2017 Thien-Thi Nguyen
Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Paul Eggert
Copyright (C) 1982, 1988, 1989 Walter Tichy
@@ -420,7 +420,6 @@ co_main (const char *cmd, int argc, char **argv)
author = date = rev = state = NULL;
joinflag = NULL;
expmode = -1;
- BE (pe) = X_DEFAULT;
tostdout = false;
Ttimeflag = false;
@@ -433,12 +432,7 @@ co_main (const char *cmd, int argc, char **argv)
case 'r':
revno:
- if (*a)
- {
- if (rev)
- PWARN ("redefinition of %s", ks_revno);
- rev = a;
- }
+ chk_set_rev (&rev, a);
break;
case 'f':
diff --git rcs-5.9.4.orig/src/gnu-h-v.c rcs-5.9.4/src/gnu-h-v.c
index 22b1caf..0cc5115 100644
--- rcs-5.9.4.orig/src/gnu-h-v.c
+++ rcs-5.9.4/src/gnu-h-v.c
@@ -1,6 +1,6 @@
/* gnu-h-v.c --- GNUish --help and --version handling
- Copyright (C) 2010-2015 Thien-Thi Nguyen
+ Copyright (C) 2010-2017 Thien-Thi Nguyen
This file is part of GNU RCS.
@@ -41,7 +41,7 @@ nice_getopt (int argc, char **argv, const struct option *longopts)
#define COMMAND_VERSION \
(" (" PACKAGE_NAME ") " PACKAGE_VERSION "\n" \
- "Copyright (C) 2010-2015 Thien-Thi Nguyen\n" \
+ "Copyright (C) 2010-2017 Thien-Thi Nguyen\n" \
"Copyright (C) 1990-1995 Paul Eggert\n" \
"Copyright (C) 1982,1988,1989 Walter F. Tichy, Purdue CS\n" \
"License GPLv3+: GNU GPL version 3 or later" \
diff --git rcs-5.9.4.orig/src/gnu-h-v.h rcs-5.9.4/src/gnu-h-v.h
index 2d406c6..0250b23 100644
--- rcs-5.9.4.orig/src/gnu-h-v.h
+++ rcs-5.9.4/src/gnu-h-v.h
@@ -1,6 +1,6 @@
/* gnu-h-v.h --- GNUish --help and --version handling
- Copyright (C) 2010-2015 Thien-Thi Nguyen
+ Copyright (C) 2010-2017 Thien-Thi Nguyen
This file is part of GNU RCS.
diff --git rcs-5.9.4.orig/src/ident.c rcs-5.9.4/src/ident.c
index 53ef72f..9299f45 100644
--- rcs-5.9.4.orig/src/ident.c
+++ rcs-5.9.4/src/ident.c
@@ -1,6 +1,6 @@
/* Identify RCS keyword strings in files.
- Copyright (C) 2010-2015 Thien-Thi Nguyen
+ Copyright (C) 2010-2017 Thien-Thi Nguyen
Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Paul Eggert
Copyright (C) 1982, 1988, 1989 Walter Tichy
diff --git rcs-5.9.4.orig/src/maketime.c rcs-5.9.4/src/maketime.c
index cb3795f..fb51e09 100644
--- rcs-5.9.4.orig/src/maketime.c
+++ rcs-5.9.4/src/maketime.c
@@ -1,6 +1,6 @@
/* Convert struct partime into time_t.
- Copyright (C) 2010-2015 Thien-Thi Nguyen
+ Copyright (C) 2010-2017 Thien-Thi Nguyen
Copyright (C) 1992, 1993, 1994, 1995 Paul Eggert
This file is part of GNU RCS.
diff --git rcs-5.9.4.orig/src/maketime.h rcs-5.9.4/src/maketime.h
index c1cdf6e..63b3611 100644
--- rcs-5.9.4.orig/src/maketime.h
+++ rcs-5.9.4/src/maketime.h
@@ -1,6 +1,6 @@
/* Return time_t from struct partime returned by partime.
- Copyright (C) 2010-2015 Thien-Thi Nguyen
+ Copyright (C) 2010-2017 Thien-Thi Nguyen
Copyright (C) 1993, 1994, 1995 Paul Eggert
This file is part of GNU RCS.
diff --git rcs-5.9.4.orig/src/merge.c rcs-5.9.4/src/merge.c
index b75fd44..623d2d3 100644
--- rcs-5.9.4.orig/src/merge.c
+++ rcs-5.9.4/src/merge.c
@@ -1,6 +1,6 @@
/* Three-way file merge.
- Copyright (C) 2010-2015 Thien-Thi Nguyen
+ Copyright (C) 2010-2017 Thien-Thi Nguyen
Copyright (C) 1991, 1992, 1993, 1994, 1995 Paul Eggert
This file is part of GNU RCS.
@@ -114,7 +114,7 @@ Options:
-e Use `diff3 -e' style.
-p Write to stdout instead of overwriting RECEIVING-SIBLING.
-q Quiet mode; suppress conflict warnings.
- -LLABEL (up to three times) Specify the conflict labels for
+ -L LABEL (up to three times) Specify the conflict labels for
RECEIVING-SIBLING, PARENT and OTHER-SIBLING, respectively.
-V Obsolete; do not use.
*/
diff --git rcs-5.9.4.orig/src/merger.c rcs-5.9.4/src/merger.c
index 33d3f35..c3f2aef 100644
--- rcs-5.9.4.orig/src/merger.c
+++ rcs-5.9.4/src/merger.c
@@ -1,6 +1,6 @@
/* three-way file merge internals
- Copyright (C) 2010-2015 Thien-Thi Nguyen
+ Copyright (C) 2010-2017 Thien-Thi Nguyen
Copyright (C) 1991, 1992, 1993, 1994, 1995 Paul Eggert
This file is part of GNU RCS.
@@ -29,19 +29,6 @@
#include "b-fro.h"
#include "b-merger.h"
-static char const *
-normalize_arg (char const *s)
-/* If s looks like an option, prepend ./ to it. Return the result. */
-{
- if (*s == '-')
- {
- accf (PLEXUS, ".%c", SLASH);
- return str_save (s);
- }
- else
- return s;
-}
-
int
merge (bool tostdout, char const *edarg, struct symdef three_manifestations[3])
/* Do merge [-p] EDARG -L l0 -L l1 -L l2 a0 a1 a2, where tostdout
@@ -57,7 +44,18 @@ merge (bool tostdout, char const *edarg, struct symdef three_manifestations[3])
int s;
for (i = 3; 0 <= --i;)
- a[i] = normalize_arg (FNAME (i));
+ {
+ char const *filename = FNAME (i);
+
+ /* If a filename begins with hyphen, prepend ./. */
+ if ('-' == filename[0])
+ {
+ accf (PLEXUS, ".%c", SLASH);
+ a[i] = str_save (filename);
+ }
+ else
+ a[i] = filename;
+ }
if (!edarg)
edarg = "-E";
diff --git rcs-5.9.4.orig/src/partime.c rcs-5.9.4/src/partime.c
index e81f47b..ea10956 100644
--- rcs-5.9.4.orig/src/partime.c
+++ rcs-5.9.4/src/partime.c
@@ -1,6 +1,6 @@
/* Parse a string, returning a struct partime that describes it.
- Copyright (C) 2010-2015 Thien-Thi Nguyen
+ Copyright (C) 2010-2017 Thien-Thi Nguyen
Copyright (C) 1993, 1994, 1995 Paul Eggert
This file is part of GNU RCS.
@@ -271,12 +271,13 @@ parse_decimal (char const *s, int digits, int lo, int hi,
return NULL;
}
-char const*
+char const *
parzone (char const *s, long *zone)
-/* Parse an initial prefix of s; it must denote a time zone. Set *zone
- to the number of seconds east of GMT, or to TM_LOCAL_ZONE if it is the
- local time zone. Return the first character after the prefix, or 0 if it
- couldn't be parsed. */
+/* Try to parse an initial prefix of s; it must denote a time zone.
+ If s cannot be parsed, return NULL. Otherwise, set *zone to
+ the number of seconds east of GMT, or to TM_LOCAL_ZONE if it is
+ the local time zone, and return a pointer to the first character
+ after the prefix. */
{
char sign;
int hh, mm, ss;
@@ -334,6 +335,7 @@ parzone (char const *s, long *zone)
case '+':
break;
default:
+ *zone = z;
return s;
}
}
diff --git rcs-5.9.4.orig/src/partime.h rcs-5.9.4/src/partime.h
index e81ab64..08bfcf0 100644
--- rcs-5.9.4.orig/src/partime.h
+++ rcs-5.9.4/src/partime.h
@@ -1,6 +1,6 @@
/* Parse a string, returning a struct partime that describes it.
- Copyright (C) 2010-2015 Thien-Thi Nguyen
+ Copyright (C) 2010-2017 Thien-Thi Nguyen
Copyright (C) 1993, 1994, 1995 Paul Eggert
This file is part of GNU RCS.
diff --git rcs-5.9.4.orig/src/rcs.c rcs-5.9.4/src/rcs.c
index ef15e97..8440ba7 100644
--- rcs-5.9.4.orig/src/rcs.c
+++ rcs-5.9.4/src/rcs.c
@@ -1,6 +1,6 @@
/* Change RCS file attributes.
- Copyright (C) 2010-2015 Thien-Thi Nguyen
+ Copyright (C) 2010-2017 Thien-Thi Nguyen
Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Paul Eggert
Copyright (C) 1982, 1988, 1989 Walter Tichy
@@ -354,9 +354,8 @@ scanlogtext (struct adminstuff *dc,
}
else if (nextdelta->pretty_log.string && nextdelta->selector)
{
- afputc (SDELIM, to);
- putstring (to, false, nextdelta->pretty_log, true);
- afputc ('\n', to);
+ putstring (to, nextdelta->pretty_log, true);
+ newline (to);
}
else if (to)
atat_put (to, log);
@@ -1126,7 +1125,6 @@ rcs_main (const char *cmd, int argc, char **argv)
boxrm.next = dc.byelocks;
tprm = &boxrm;
expmode = -1;
- BE (pe) = X_DEFAULT;
initflag = textflag = false;
strict_selected = false;
Ttimeflag = false;
diff --git rcs-5.9.4.orig/src/rcsclean.c rcs-5.9.4/src/rcsclean.c
index edff4e8..5af064d 100644
--- rcs-5.9.4.orig/src/rcsclean.c
+++ rcs-5.9.4/src/rcsclean.c
@@ -1,6 +1,6 @@
/* Clean up working files.
- Copyright (C) 2010-2015 Thien-Thi Nguyen
+ Copyright (C) 2010-2017 Thien-Thi Nguyen
Copyright (C) 1991, 1992, 1993, 1994, 1995 Paul Eggert
This file is part of GNU RCS.
@@ -122,7 +122,6 @@ rcsclean_main (const char *cmd, int argc, char **argv)
expmode = -1;
rev = NULL;
- BE (pe) = X_DEFAULT;
perform = true;
unlockflag = false;
Ttimeflag = false;
@@ -158,12 +157,7 @@ rcsclean_main (const char *cmd, int argc, char **argv)
/* fall into */
case 'r':
handle_revision:
- if (*a)
- {
- if (rev)
- PWARN ("redefinition of %s", ks_revno);
- rev = a;
- }
+ chk_set_rev (&rev, a);
break;
case 'T':
diff --git rcs-5.9.4.orig/src/rcsdiff.c rcs-5.9.4/src/rcsdiff.c
index f9df063..273e737 100644
--- rcs-5.9.4.orig/src/rcsdiff.c
+++ rcs-5.9.4/src/rcsdiff.c
@@ -1,6 +1,6 @@
/* Compare RCS revisions.
- Copyright (C) 2010-2015 Thien-Thi Nguyen
+ Copyright (C) 2010-2017 Thien-Thi Nguyen
Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Paul Eggert
Copyright (C) 1982, 1988, 1989 Walter Tichy
@@ -143,7 +143,6 @@ rcsdiff_main (const char *cmd, int argc, char **argv)
file_labels = 0;
expandarg = suffixarg = versionarg = zonearg = NULL;
no_diff_means_no_output = true;
- BE (pe) = X_DEFAULT;
/* Room for runv extra + args [+ --binary] [+ 2 labels]
+ 1 file + 1 trailing null. */
diff --git rcs-5.9.4.orig/src/rcsedit.c rcs-5.9.4/src/rcsedit.c
index c1c3e23..e9bbb81 100644
--- rcs-5.9.4.orig/src/rcsedit.c
+++ rcs-5.9.4/src/rcsedit.c
@@ -1,6 +1,6 @@
/* RCS stream editor
- Copyright (C) 2010-2015 Thien-Thi Nguyen
+ Copyright (C) 2010-2017 Thien-Thi Nguyen
Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Paul Eggert
Copyright (C) 1982, 1988, 1989 Walter Tichy
diff --git rcs-5.9.4.orig/src/rcsfcmp.c rcs-5.9.4/src/rcsfcmp.c
index 16268d0..aca065c 100644
--- rcs-5.9.4.orig/src/rcsfcmp.c
+++ rcs-5.9.4/src/rcsfcmp.c
@@ -1,6 +1,6 @@
/* Compare working files, ignoring RCS keyword strings.
- Copyright (C) 2010-2015 Thien-Thi Nguyen
+ Copyright (C) 2010-2017 Thien-Thi Nguyen
Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Paul Eggert
Copyright (C) 1982, 1988, 1989 Walter Tichy
diff --git rcs-5.9.4.orig/src/rcsfnms.c rcs-5.9.4/src/rcsfnms.c
index a96a8e4..adf0827 100644
--- rcs-5.9.4.orig/src/rcsfnms.c
+++ rcs-5.9.4/src/rcsfnms.c
@@ -1,6 +1,6 @@
/* RCS filename handling
- Copyright (C) 2010-2015 Thien-Thi Nguyen
+ Copyright (C) 2010-2017 Thien-Thi Nguyen
Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Paul Eggert
Copyright (C) 1982, 1988, 1989 Walter Tichy
@@ -222,7 +222,7 @@ fin2open (char const *d, size_t dlen,
that fails and x is nonempty, try "dbasex". Put these potential
names in m->tentative for finopen to wrangle. */
{
-#define ACC(start) accumulate_range (m->space, start, start + start ## len)
+#define ACC(start) accumulate_nbytes (m->space, start, start ## len)
#define OK() m->tentative.string = finish_string (m->space, &m->tentative.size)
/* Try "dRCS/basex". */
diff --git rcs-5.9.4.orig/src/rcsfreeze.sh rcs-5.9.4/src/rcsfreeze.sh
index 513d8f9..af0c73a 100755
--- rcs-5.9.4.orig/src/rcsfreeze.sh
+++ rcs-5.9.4/src/rcsfreeze.sh
@@ -1,7 +1,7 @@
#! /bin/sh
# rcsfreeze - assign a symbolic revision number to a configuration of RCS files
#
-# Copyright (C) 2010-2015 Thien-Thi Nguyen
+# Copyright (C) 2010-2017 Thien-Thi Nguyen
#
# This file is part of GNU RCS.
#
@@ -42,7 +42,7 @@
# {RCS/}.rscfreeze.log log messages, most recent first
##
version='rcsfreeze (GNU RCS) @PACKAGE_VERSION@
-Copyright (C) 2010-2015 Thien-Thi Nguyen
+Copyright (C) 2010-2017 Thien-Thi Nguyen
Copyright (C) 1990-1995 Paul Eggert
License GPLv3+; GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
diff --git rcs-5.9.4.orig/src/rcsgen.c rcs-5.9.4/src/rcsgen.c
index a82f5a2..5182270 100644
--- rcs-5.9.4.orig/src/rcsgen.c
+++ rcs-5.9.4/src/rcsgen.c
@@ -1,6 +1,6 @@
/* Generate RCS revisions.
- Copyright (C) 2010-2015 Thien-Thi Nguyen
+ Copyright (C) 2010-2017 Thien-Thi Nguyen
Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Paul Eggert
Copyright (C) 1982, 1988, 1989 Walter Tichy
@@ -269,7 +269,7 @@ putdesc (struct cbuf *cb, bool textflag, char *textfile)
{
FLOW (to) = NULL;
/* Get new description. */
- aprintf (frew, "\n\n%s\n%c", TINYKS (desc), SDELIM);
+ aprintf (frew, "\n\n%s\n", TINYKS (desc));
if (!textfile)
*cb = getsstdin ("t-", "description",
"NOTE: This is NOT the log message!\n");
@@ -300,8 +300,8 @@ putdesc (struct cbuf *cb, bool textflag, char *textfile)
}
*cb = cleanlogmsg (p, s);
}
- putstring (frew, false, *cb, true);
- aputc ('\n', frew);
+ putstring (frew, *cb, true);
+ newline (frew);
}
}
@@ -423,7 +423,7 @@ putadmin (void)
if (REPO (log_lead).size)
{
aprintf (fout, "%s\t", TINYKS (comment));
- putstring (fout, true, REPO (log_lead), false); SEMI_LF ();
+ putstring (fout, REPO (log_lead), false); SEMI_LF ();
}
if (kws != kwsub_kv)
aprintf (fout, "%s\t%c%s%c%s",
@@ -461,16 +461,23 @@ void
puttree (struct delta const *root, register FILE *fout)
/* Output the delta tree with base root in preorder to fout. */
{
- if (!root)
- return;
-
- if (root->selector)
- putdelta (root, fout);
-
- puttree (root->ilk, fout);
+ while (root)
+ {
+ if (root->selector)
+ putdelta (root, fout);
- for (struct wlink *ls = root->branches; ls; ls = ls->next)
- puttree (ls->entry, fout);
+ struct wlink *ls = root->branches;
+ if (! ls)
+ root = root->ilk;
+ else
+ {
+ /* FIXME: This recurses deeply in the worst case. */
+ puttree (root->ilk, fout);
+ for (; ls->next; ls = ls->next)
+ puttree (ls->entry, fout);
+ root = ls->entry;
+ }
+ }
}
bool
@@ -494,27 +501,39 @@ putdtext (struct delta const *delta, char const *srcname,
return true;
}
+static void
+put_SDELIM (FILE *out)
+{
+ aputc (SDELIM, out);
+}
+
void
-putstring (register FILE *out, bool delim, struct cbuf s, bool log)
-/* Output to out one SDELIM if delim, then the string s with
- SDELIMs doubled. If log is set then s is a log string; append
- a newline if s is nonempty. */
+putstring (register FILE *out, struct cbuf s, bool log)
+/* Output to out one SDELIM, then string s with SDELIMs doubled.
+ If log is set then s is a log string; append a newline if s is
+ nonempty. Finally, output a terminating SDELIM. */
{
register char const *sp;
- register size_t ss;
+ char const *delim;
+ register size_t ss, span;
- if (delim)
- aputc (SDELIM, out);
- sp = s.string;
- for (ss = s.size; ss; --ss)
+ put_SDELIM (out);
+ for (sp = s.string, ss = s.size;
+ ss;
+ sp += span, ss -= span)
{
- if (*sp == SDELIM)
- aputc (SDELIM, out);
- aputc (*sp++, out);
+ delim = memchr (sp, SDELIM, ss);
+ span = delim
+ ? delim - sp + 1U
+ : ss;
+
+ awrite (sp, span, out);
+ if (delim)
+ put_SDELIM (out);
}
if (s.size && log)
- aputc ('\n', out);
- aputc (SDELIM, out);
+ newline (out);
+ put_SDELIM (out);
}
void
@@ -532,8 +551,8 @@ putdftext (struct delta const *delta, struct fro *finfile,
aprintf (fout, "\n\n%s\n%s\n", delta->num, TINYKS (log));
/* Put log. */
- putstring (fout, true, delta->pretty_log, true);
- aputc ('\n', fout);
+ putstring (fout, delta->pretty_log, true);
+ newline (fout);
/* Put text. */
aprintf (fout, "%s\n%c", TINYKS (text), SDELIM);
@@ -546,7 +565,7 @@ putdftext (struct delta const *delta, struct fro *finfile,
GETCHAR_OR (c, fin, goto done);
if (c == SDELIM)
/* Double up SDELIM. */
- aputc (SDELIM, fout);
+ put_SDELIM (fout);
aputc (c, fout);
}
done:
@@ -568,7 +587,7 @@ putdftext (struct delta const *delta, struct fro *finfile,
unexpected_EOF ();
});
if (c == SDELIM)
- aputc (SDELIM, fout);
+ put_SDELIM (fout);
aputc (c, fout);
}
while (c != '\n');
diff --git rcs-5.9.4.orig/src/rcskeep.c rcs-5.9.4/src/rcskeep.c
index 85fd68b..27e3242 100644
--- rcs-5.9.4.orig/src/rcskeep.c
+++ rcs-5.9.4/src/rcskeep.c
@@ -1,6 +1,6 @@
/* Extract RCS keyword string values from working files.
- Copyright (C) 2010-2015 Thien-Thi Nguyen
+ Copyright (C) 2010-2017 Thien-Thi Nguyen
Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Paul Eggert
Copyright (C) 1982, 1988, 1989 Walter Tichy
diff --git rcs-5.9.4.orig/src/rcsmap.c rcs-5.9.4/src/rcsmap.c
index 3586572..e412c2b 100644
--- rcs-5.9.4.orig/src/rcsmap.c
+++ rcs-5.9.4/src/rcsmap.c
@@ -1,6 +1,6 @@
/* RCS map of character types
- Copyright (C) 2010-2015 Thien-Thi Nguyen
+ Copyright (C) 2010-2017 Thien-Thi Nguyen
Copyright (C) 1990, 1991, 1995 Paul Eggert
Copyright (C) 1982, 1988, 1989 Walter Tichy
diff --git rcs-5.9.4.orig/src/rcsmerge.c rcs-5.9.4/src/rcsmerge.c
index 8affcb1..d410284 100644
--- rcs-5.9.4.orig/src/rcsmerge.c
+++ rcs-5.9.4/src/rcsmerge.c
@@ -1,6 +1,6 @@
/* Merge RCS revisions.
- Copyright (C) 2010-2015 Thien-Thi Nguyen
+ Copyright (C) 2010-2017 Thien-Thi Nguyen
Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Paul Eggert
Copyright (C) 1982, 1988, 1989 Walter Tichy
@@ -54,7 +54,6 @@ rcsmerge_main (const char *cmd, int argc, char **argv)
status = 0; /* Keep lint happy. */
tostdout = false;
expandarg = suffixarg = versionarg = zonearg = quietarg; /* no-op */
- BE (pe) = X_DEFAULT;
argc = getRCSINIT (argc, argv, &newargv);
argv = newargv;
diff --git rcs-5.9.4.orig/src/rcsrev.c rcs-5.9.4/src/rcsrev.c
index b378d45..e6edc61 100644
--- rcs-5.9.4.orig/src/rcsrev.c
+++ rcs-5.9.4/src/rcsrev.c
@@ -1,6 +1,6 @@
/* Handle RCS revision numbers.
- Copyright (C) 2010-2015 Thien-Thi Nguyen
+ Copyright (C) 2010-2017 Thien-Thi Nguyen
Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Paul Eggert
Copyright (C) 1982, 1988, 1989 Walter Tichy
diff --git rcs-5.9.4.orig/src/rcstime.c rcs-5.9.4/src/rcstime.c
index 008c70d..3d9aab7 100644
--- rcs-5.9.4.orig/src/rcstime.c
+++ rcs-5.9.4/src/rcstime.c
@@ -1,6 +1,6 @@
/* Convert between RCS time format and POSIX and/or C formats.
- Copyright (C) 2010-2015 Thien-Thi Nguyen
+ Copyright (C) 2010-2017 Thien-Thi Nguyen
Copyright (C) 1992, 1993, 1994, 1995 Paul Eggert
This file is part of GNU RCS.
diff --git rcs-5.9.4.orig/src/rcsutil.c rcs-5.9.4/src/rcsutil.c
index e7e137d..e5f1f0c 100644
--- rcs-5.9.4.orig/src/rcsutil.c
+++ rcs-5.9.4/src/rcsutil.c
@@ -1,6 +1,6 @@
/* RCS utility functions
- Copyright (C) 2010-2015 Thien-Thi Nguyen
+ Copyright (C) 2010-2017 Thien-Thi Nguyen
Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Paul Eggert
Copyright (C) 1982, 1988, 1989 Walter Tichy
@@ -52,8 +52,14 @@
#endif /* defined USE_NORMAL_EXIT */
static void
-exit_diff_trouble (void)
+exit_diff_trouble (char const *fmt, ...)
{
+ va_list args;
+
+ /* Avoid perror since it may misuse buffers. */
+ va_start (args, fmt);
+ vcomplain (fmt, args);
+ va_end (args);
_Exit (DIFF_TROUBLE);
}
@@ -82,6 +88,9 @@ gnurcs_init (struct program const *program)
top = ZLLOC (1, struct top);
unbuffer_standard_error ();
top->program = program;
+ BE (pe) = WOE
+ ? "\\,v"
+ : ",v";
ISR_SCRATCH = isr_init (&BE (quiet));
init_ephemstuff ();
BE (maketimestuff) = ZLLOC (1, struct maketimestuff);
@@ -128,6 +137,18 @@ redefined (int c)
PWARN ("redefinition of -%c option", c);
}
+void
+chk_set_rev (const char **rev, char *arg)
+{
+ if (! *arg)
+ return;
+
+ if (*rev)
+ PWARN ("redefinition of %s", ks_revno);
+
+ *rev = arg;
+}
+
struct cbuf
minus_p (char const *xrev, char const *rev)
{
@@ -325,20 +346,14 @@ runv (int infd, char const *outname, char const **args)
&& STDIN_FILENO != infd
&& STDIN_FILENO != (close (STDIN_FILENO),
fcntl (infd, F_DUPFD, STDIN_FILENO)))
- {
- /* Avoid perror since it may misuse buffers. */
- complain ("%s: I/O redirection failed\n", args[1]);
- exit_diff_trouble ();
- }
+ exit_diff_trouble ("%s: I/O redirection failed\n",
+ args[1]);
if (outname)
if (PROB (fdreopen (STDOUT_FILENO, outname,
O_CREAT | O_TRUNC | O_WRONLY)))
- {
- /* Avoid perror since it may misuse buffers. */
- complain ("%s: %s: cannot create\n", args[1], outname);
- exit_diff_trouble ();
- }
+ exit_diff_trouble ("%s: %s: cannot create\n",
+ args[1], outname);
EXECV (args[1], (char **) (args + 1));
notfound = args[1];
#ifdef RCS_SHELL
@@ -349,9 +364,7 @@ runv (int infd, char const *outname, char const **args)
}
#endif
- /* Avoid perror since it may misuse buffers. */
- complain ("%s: not found\n", notfound);
- exit_diff_trouble ();
+ exit_diff_trouble ("%s: not found\n", notfound);
}
if (PROB (pid))
fatal_sys ("fork");
diff --git rcs-5.9.4.orig/src/rlog.c rcs-5.9.4/src/rlog.c
index 0f111bb..549ac9e 100644
--- rcs-5.9.4.orig/src/rlog.c
+++ rcs-5.9.4/src/rlog.c
@@ -1,6 +1,6 @@
/* Print log messages and other information about RCS files.
- Copyright (C) 2010-2015 Thien-Thi Nguyen
+ Copyright (C) 2010-2017 Thien-Thi Nguyen
Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Paul Eggert
Copyright (C) 1982, 1988, 1989 Walter Tichy
@@ -132,9 +132,10 @@ static void
count_a_d (long *a, long *d, struct atat *edits)
{
struct cbuf s = string_from_atat (SINGLE, edits);
+ char const *end = s.string + s.size;
long *totals = zlloc (SINGLE, __func__, 2 * sizeof (long));
- for (char const *p = s.string; p < s.string + s.size; p++)
+ for (char const *p = s.string; p < end; p++)
{
bool addp = ('a' == *p++);
long count;
@@ -147,9 +148,13 @@ count_a_d (long *a, long *d, struct atat *edits)
if (addp)
/* Ignore the actual lines. */
while (count--)
- if (! (p = strchr (++p, '\n')))
- /* No final newline; skip out. */
- goto done;
+ {
+ size_t remaining = end - p;
+
+ if (! (p = memchr (++p, '\n', remaining)))
+ /* No final newline; skip out. */
+ goto done;
+ }
}
done:
*a = totals[1];
@@ -158,22 +163,16 @@ count_a_d (long *a, long *d, struct atat *edits)
}
static void
-putadelta (register struct delta const *node,
- register struct delta const *editscript,
- bool trunk, const char *insDelFormat)
-/* Print delta node if node->selector is set.
- editscript indicates where the editscript is stored;
- trunk !false indicates this node is in trunk. */
+putadelta (struct delta const *node, struct delta const *editscript,
+ char const *insDelFormat)
+/* Print delta node. editscript indicates where the editscript is
+ stored; it equals node if this node is not in trunk. */
{
- register FILE *out;
+ FILE *out = stdout;
char datebuf[datesize + zonelenmax];
bool pre5 = BE (version) < VERSION (5);
struct atat *log;
- if (!node->selector)
- return;
-
- out = stdout;
aprintf (out, "----------------------------\nrevision %s%s",
node->num, pre5 ? " " : "");
if (node->lockedby)
@@ -184,6 +183,7 @@ putadelta (register struct delta const *node,
if (editscript && editscript != REPO (tip))
{
+ bool trunk = node != editscript;
long a, d;
count_a_d (trunk ? &d : &a,
@@ -206,7 +206,7 @@ putadelta (register struct delta const *node,
if (node->commitid)
aprintf (out, "%s commitid: %s", editscript ? ";" : "", node->commitid);
- afputc ('\n', out);
+ newline (out);
if ((log = node->log)
&& log->beg + 1 < ATAT_END (log))
atat_display (out, log, true);
@@ -218,47 +218,60 @@ static void
putrunk (const char *insDelFormat)
/* Print revisions chosen, which are in trunk. */
{
- register struct delta const *ptr;
-
- for (ptr = REPO (tip); ptr; ptr = ptr->ilk)
- putadelta (ptr, ptr->ilk, true, insDelFormat);
+ for (struct delta const *ptr = REPO (tip); ptr; ptr = ptr->ilk)
+ if (ptr->selector)
+ putadelta (ptr, ptr->ilk, insDelFormat);
}
-static void putforest (struct wlink const *branchroot, const char *insDelFormat);
+static struct delta const *putforest (struct wlink const *, const char *);
static void
putree (struct delta const *root, const char *insDelFormat)
/* Print delta tree from root (not including trunk)
in reverse order on each branch. */
{
- if (!root)
- return;
- putree (root->ilk, insDelFormat);
- putforest (root->branches, insDelFormat);
+ while (root)
+ if (! root->branches)
+ root = root->ilk;
+ else
+ {
+ /* FIXME: This recurses deeply in the worst case. */
+ putree (root->ilk, insDelFormat);
+ root = putforest (root->branches, insDelFormat);
+ }
}
static void
putabranch (struct delta const *root, const char *insDelFormat)
/* Print one branch from root. */
{
- if (!root)
- return;
- putabranch (root->ilk, insDelFormat);
- putadelta (root, root, false, insDelFormat);
+ while (!root->selector)
+ {
+ root = root->ilk;
+ if (!root)
+ return;
+ }
+
+ /* FIXME: This recurses deeply in the worst case. */
+ if (root->ilk)
+ putabranch (root->ilk, insDelFormat);
+
+ putadelta (root, root, insDelFormat);
}
-static void
+static struct delta const *
putforest (struct wlink const *branchroot, const char *insDelFormat)
/* Print branches that have the same direct ancestor branchroot. */
{
- if (!branchroot)
- return;
- putforest (branchroot->next, insDelFormat);
+ /* FIXME: This recurses deeply in the worst case. */
+ if (branchroot->next)
+ putforest (branchroot->next, insDelFormat);
+
putabranch (branchroot->entry, insDelFormat);
- putree (branchroot->entry, insDelFormat);
+ return branchroot->entry;
}
-static char
+static bool
extractdelta (struct delta const *pdelta, bool lockflag,
struct criteria *criteria)
/* Return true if pdelta matches the selection critera. */
@@ -301,17 +314,23 @@ exttree (struct delta *root, bool lockflag,
struct criteria *criteria)
/* Select revisions, starting with root. */
{
- if (!root)
- return;
-
- root->selector = extractdelta (root, lockflag, criteria);
- root->pretty_log.string = NULL;
-#define RECURSE(x) exttree (x, lockflag, criteria)
- RECURSE (root->ilk);
+ while (root)
+ {
+ root->selector = extractdelta (root, lockflag, criteria);
+ root->pretty_log.string = NULL;
- for (struct wlink *ls = root->branches; ls; ls = ls->next)
- RECURSE (ls->entry);
-#undef RECURSE
+ if (! root->branches)
+ root = root->ilk;
+ else
+ {
+ /* FIXME: This recurses deeply in the worst case. */
+ struct wlink *ls;
+ exttree (root->ilk, lockflag, criteria);
+ for (ls = root->branches; ls->next; ls = ls->next)
+ exttree (ls->entry, lockflag, criteria);
+ root = ls->entry;
+ }
+ }
}
static void
@@ -427,73 +446,78 @@ recentdate (struct delta const *root, struct daterange *r)
interval given by pd, and set the strtdate of pd to the date
of the selected delta. */
{
- if (!root)
- return;
- if (root->selector)
+ while (root)
{
- if (!DATE_LT (root->date, r->beg)
+ if (root->selector
+ && !DATE_LT (root->date, r->beg)
&& !DATE_GT (root->date, r->end))
{
strncpy (r->beg, root->date, datesize);
r->beg[datesize - 1] = '\0';
}
- }
- recentdate (root->ilk, r);
- for (struct wlink *ls = root->branches; ls; ls = ls->next)
- recentdate (ls->entry, r);
+ struct wlink *ls = root->branches;
+ if (!ls)
+ root = root->ilk;
+ else
+ {
+ /* FIXME: This recurses deeply in the worst case. */
+ for (; ls->next; ls = ls->next)
+ recentdate (ls->entry, r);
+ root = ls->entry;
+ }
+ }
}
-static int
+static size_t
extdate (struct delta *root, struct date_selection *datesel)
/* Select revisions which are in the date range specified in datesel->by
and datesel->in, starting at root. Return number of revisions
selected, including those already selected. */
{
- int revno;
-
- if (!root)
- return 0;
+ size_t revno = 0;
- if (datesel->in || datesel->by)
+ for (; root; root = root->ilk)
{
- struct daterange const *r;
- bool oep, sel = false;
-
- for (struct link *ls = datesel->in; ls; ls = ls->next)
- {
- r = ls->entry;
- oep = r->oep;
- if ((sel = ((!r->beg[0]
- || (oep
- ? DATE_LT (r->beg, root->date)
- : !DATE_GT (r->beg, root->date)))
- &&
- (!r->end[0]
- || (oep
- ? DATE_LT (root->date, r->end)
- : !DATE_GT (root->date, r->end))))))
- break;
- }
- if (!sel)
+ if (datesel->in || datesel->by)
{
- for (struct link *ls = datesel->by; ls; ls = ls->next)
+ struct daterange const *r;
+ bool oep, sel = false;
+
+ for (struct link *ls = datesel->in; ls; ls = ls->next)
{
r = ls->entry;
- if ((sel = DATE_EQ (root->date, r->beg)))
+ oep = r->oep;
+ if ((sel = ((!r->beg[0]
+ || (oep
+ ? DATE_LT (r->beg, root->date)
+ : !DATE_GT (r->beg, root->date)))
+ &&
+ (!r->end[0]
+ || (oep
+ ? DATE_LT (root->date, r->end)
+ : !DATE_GT (root->date, r->end))))))
break;
}
if (!sel)
- root->selector = false;
+ {
+ for (struct link *ls = datesel->by; ls; ls = ls->next)
+ {
+ r = ls->entry;
+ if ((sel = DATE_EQ (root->date, r->beg)))
+ break;
+ }
+ if (!sel)
+ root->selector = false;
+ }
}
- }
-#define RECURSE(x) extdate (x, datesel)
- revno = root->selector + RECURSE (root->ilk);
+ revno += root->selector;
- for (struct wlink *ls = root->branches; ls; ls = ls->next)
- revno += RECURSE (ls->entry);
-#undef RECURSE
+ /* FIXME: This recurses deeply in the worst case. */
+ for (struct wlink *ls = root->branches; ls; ls = ls->next)
+ revno += extdate (ls->entry, datesel);
+ }
return revno;
}
@@ -750,7 +774,7 @@ rlog_main (const char *cmd, int argc, char **argv)
bool onlyRCSflag; /* print only RCS filename */
bool pre5;
bool shownames;
- int revno;
+ size_t revno;
CHECK_HV (cmd);
gnurcs_init (&program);
@@ -758,7 +782,6 @@ rlog_main (const char *cmd, int argc, char **argv)
descflag = selectflag = shownames = true;
onlylockflag = onlyRCSflag = false;
out = stdout;
- BE (pe) = X_DEFAULT;
argc = getRCSINIT (argc, argv, &newargv);
argv = newargv;
@@ -970,10 +993,10 @@ rlog_main (const char *cmd, int argc, char **argv)
revno = extdate (tip, &datesel);
- aprintf (out, ";\tselected revisions: %d", revno);
+ aprintf (out, ";\tselected revisions: %zu", revno);
}
- afputc ('\n', out);
+ newline (out);
if (descflag)
{
struct atat *desc = GROK (desc);
diff --git rcs-5.9.4.orig/src/sub.TEMPLATE rcs-5.9.4/src/sub.TEMPLATE
index b3367ff..c6f215d 100755
--- rcs-5.9.4.orig/src/sub.TEMPLATE
+++ rcs-5.9.4/src/sub.TEMPLATE
@@ -1,7 +1,7 @@
#!/bin/sh
# SUB (GNU RCS) VERSION
#
-# Copyright (C) 2013-2015 Thien-Thi Nguyen
+# Copyright (C) 2013-2017 Thien-Thi Nguyen
#
# This file is part of GNU RCS.
#
diff --git rcs-5.9.4.orig/src/super.c rcs-5.9.4/src/super.c
index 43f6d6c..6e1a0bb 100644
--- rcs-5.9.4.orig/src/super.c
+++ rcs-5.9.4/src/super.c
@@ -1,6 +1,6 @@
/* Dispatch an RCS command.
- Copyright (C) 2013-2015 Thien-Thi Nguyen
+ Copyright (C) 2013-2017 Thien-Thi Nguyen
This file is part of GNU RCS.
diff --git rcs-5.9.4.orig/tests/ChangeLog rcs-5.9.4/tests/ChangeLog
index 2aca0ca..5e96a1a 100644
--- rcs-5.9.4.orig/tests/ChangeLog
+++ rcs-5.9.4/tests/ChangeLog
@@ -1,3 +1,231 @@
+2016-10-31 Thien-Thi Nguyen <ttn@gnu.org>
+
+ [v cov] Add test case for rlog "empty log message" output.
+
+ * t310: ...here, immediately prior to commitid test case.
+
+2016-10-30 Thien-Thi Nguyen <ttn@gnu.org>
+
+ [v cov] Add another rcs -s test case.
+
+ * t607: Add case for multichar invalid identifier.
+
+2016-10-30 Thien-Thi Nguyen <ttn@gnu.org>
+
+ [v cov] Add some '@' chars in log, text strings.
+
+ * fake/two (4.21): Add '@' in text string.
+ (4.20): Add '@' in log string.
+ * t160: Update accordingly.
+
+2016-10-30 Thien-Thi Nguyen <ttn@gnu.org>
+
+ [v] Add some checks for unrecognized date/time handling.
+
+ * t314 (flail): New func.
+ <top-level>: Add two checks for rlog -d and rlog -z.
+
+2016-10-29 Thien-Thi Nguyen <ttn@gnu.org>
+
+ [v] Add test for rcs -i -kSUBST.
+
+ * t500: New file.
+ * Makefile.am (TESTS): Add t500.
+
+2016-10-29 Thien-Thi Nguyen <ttn@gnu.org>
+
+ [v] Add check for rcsdiff handling of "slightly binary" files.
+
+ * t160: ...here, after all other checks.
+
+2016-10-29 Thien-Thi Nguyen <ttn@gnu.org>
+
+ [v int] Precompute nul-in-ed-script RCS file.
+
+ * fake/nul-in-ed-script.GNUmakefile: New file.
+ * fake/nul-in-ed-script: New file.
+ * t807: Don't create $v; instead, copy from nul-in-ed-script.
+
+2016-10-29 Thien-Thi Nguyen <ttn@gnu.org>
+
+ rlog: Fix bug: Handle ed script with embedded NUL.
+
+ * Makefile.am (XFAIL_TESTS): Remove t807.
+
+2016-10-29 Thien-Thi Nguyen <ttn@gnu.org>
+
+ [v] Add test for rlog +/- summation in presence of NUL.
+
+ * t807: New file.
+ * Makefile.am (TESTS, XFAIL_TESTS): Add t807.
+ * known-failures.in (5.8, 5.8.1, 5.8.2)
+ (5.9.0, 5.9.1, 5.9.2, 5.9.3, 5.9.4): Add t807.
+
+2016-10-27 Thien-Thi Nguyen <ttn@gnu.org>
+
+ Fix bug: Handle time-zone specified sans numeric offset.
+
+ * Makefile.am (XFAIL_TESTS): Remove t314.
+
+2016-10-27 Thien-Thi Nguyen <ttn@gnu.org>
+
+ [v] Add test for rlog -d and -z.
+
+ * t314: New file.
+ * Makefile.am (TESTS, XFAIL_TESTS): Add t314.
+ * known-failures.in (5.7, 5.8, 5.8.1, 5.8.2)
+ (5.9.0, 5.9.1, 5.9.2, 5.9.3, 5.9.4): Add t314.
+
+2016-10-24 Thien-Thi Nguyen <ttn@gnu.org>
+
+ [v] Exercise env var RCSINIT processing.
+
+ * t999: ...here, prior to last rlog(1) command, w/ a
+ value that includes multiple options, requiring a space.
+
+2016-10-22 Thien-Thi Nguyen <ttn@gnu.org>
+
+ [v] Add sanity check for btdt getoldkeys.
+
+ * t030: ...here, prior to other tests.
+
+2016-10-21 Thien-Thi Nguyen <ttn@gnu.org>
+
+ [v] Add checks for rlog -V... errors.
+
+ * t150 (flail): New func.
+ <top-level>: Copy empty comma-v to $v; do set +e;
+ use flail to check rlog -V2 and rlog -V5X.
+
+2016-10-21 Thien-Thi Nguyen <ttn@gnu.org>
+
+ [v] Add check for warning for rcs -V.
+
+ * t150: ...here, for RCS 5.9.0 and later.
+
+2016-10-21 Thien-Thi Nguyen <ttn@gnu.org>
+
+ [v] Add case for rcsclean test.
+
+ * t790: Invoke w/ -V4 -V3; check stderr output, too.
+
+2016-10-21 Thien-Thi Nguyen <ttn@gnu.org>
+
+ [v] Add test for rlog warning for lock held on non-existent revision.
+
+ * t302: New file.
+ * Makefile.am (TESTS): Add t302.
+
+2016-10-21 Thien-Thi Nguyen <ttn@gnu.org>
+
+ [v] Add cases to "rlog on invalid RCS file" test.
+
+ * t300: Add three test cases:
+ invalid substitution mode,
+ head names a non-existent revision,
+ spurious edits w/o corresponding index.
+
+2016-10-21 Thien-Thi Nguyen <ttn@gnu.org>
+
+ [grok] Fix bug: Detect/diagnose missing string correctly.
+
+ * Makefile.am (XFAIL_TESTS): Remove t806.
+
+2016-10-20 Thien-Thi Nguyen <ttn@gnu.org>
+
+ [v] Add test for missing string after desc, log, text.
+
+ * t806: New file.
+ * Makefile.am (TESTS, XFAIL_TESTS): Add t806.
+ * known-failures.in (5.8, 5.8.1, 5.8.2)
+ (5.9.0, 5.9.1, 5.9.2, 5.9.3, 5.9.4): Add t806.
+
+2016-10-14 Thien-Thi Nguyen <ttn@gnu.org>
+
+ [v] Add checks for ident(1) w/ various options, arguments.
+
+ * t390: Source $srcdir/common-v.
+ (flail): New func.
+ <Misc. command-line handling>:
+ Rewrite existing test to use flail;
+ add more tests; add tests for 5.9.0 and later.
+
+2016-10-13 Thien-Thi Nguyen <ttn@gnu.org>
+
+ [v] Add test for merge(1) w/ invalid options, arguments.
+
+ * t181: New file.
+ * Makefile.am (TESTS): Add t181.
+
+2016-10-13 Thien-Thi Nguyen <ttn@gnu.org>
+
+ [v] Add checks for rcs no-such-command and rcs --help COMMAND.
+
+ * t150: Source $srcdir/common-v;
+ if prior to 5.9.0, exit early;
+ check that rcs no-such-command fails;
+ check that rcs --help COMMAND produces
+ identical output as COMMAND --help.
+
+2016-10-13 Thien-Thi Nguyen <ttn@gnu.org>
+
+ [v] Add check for invalid option handling.
+
+ * t150: ...here, with nonsense option --no-such-option.
+
+2016-10-13 Thien-Thi Nguyen <ttn@gnu.org>
+
+ [v int] Make versioning infrastructure handle rcs -V.
+
+ * common-v (ver): Don't normalize the version
+ for RCS 5.7 and earlier; instead, use rcs -V.
+
+2016-10-13 Thien-Thi Nguyen <ttn@gnu.org>
+
+ [v] Add test for rcs --commands and rcs --aliases.
+
+ * t151: New file.
+ * Makefile.am (TESTS): Add t151.
+
+2016-10-13 Thien-Thi Nguyen <ttn@gnu.org>
+
+ [v int] Add versioning infrastructure.
+
+ * common-v: New file.
+ * Makefile.am (EXTRA_DIST): Add common-v.
+
+2015-02-20 Thien-Thi Nguyen <ttn@gnu.org>
+
+ [v] Spell "substitution" correctly.
+
+ * t380: ...here, in comments and error message.
+
+2015-02-02 Thien-Thi Nguyen <ttn@gnu.org>
+
+ [v slog] Jam both LOGNAME and USER env vars.
+
+ LOGNAME is readonly under AIX. Reported by Michael Felt:
+ <http://lists.gnu.org/archive/html/bug-rcs/2015-01/msg00019.html>.
+
+ * t900: ...here. Also, discard stderr for LOGNAME assignment.
+
+2015-01-27 Thien-Thi Nguyen <ttn@gnu.org>
+
+ [v slog] Fix bug: Propagate makefile var LIBTHREAD.
+
+ This is related to ../src/Makefile.am change of similar title.
+
+ * Makefile.am (btdt_LDADD): Append $(LIBTHREAD), as well.
+
+2015-01-23 Thien-Thi Nguyen <ttn@gnu.org>
+
+ [v int] Make sure all tests end with "exit 0".
+
+ * t150: Add "exit 0" at end.
+ * t510: Likewise.
+ * t511: Likewise.
+ * t999: Likewise.
+
2015-01-22 Thien-Thi Nguyen <ttn@gnu.org>
Release: 5.9.4
@@ -1373,7 +1601,7 @@
* t000.test: New file.
-Copyright (C) 2010-2015 Thien-Thi Nguyen
+Copyright (C) 2010-2017 Thien-Thi Nguyen
Copying and distribution of this file, with or without modification,
are permitted provided the copyright notice and this notice are preserved.
diff --git rcs-5.9.4.orig/tests/Makefile.am rcs-5.9.4/tests/Makefile.am
index 84ee2a6..8d1a9de 100644
--- rcs-5.9.4.orig/tests/Makefile.am
+++ rcs-5.9.4/tests/Makefile.am
@@ -1,6 +1,6 @@
# Validate RCS behavior.
-# Copyright (C) 2010-2015 Thien-Thi Nguyen
+# Copyright (C) 2010-2017 Thien-Thi Nguyen
#
# This file is part of GNU RCS.
#
@@ -24,6 +24,9 @@ check_PROGRAMS = btdt
AM_CPPFLAGS = -I$(top_srcdir)/src -I$(top_srcdir)/lib
btdt_LDADD = ../src/libparts.a ../lib/libgnu.a
+## This is segregated in case we want to conditionalize, later.
+btdt_LDADD += $(LIBTHREAD)
+
# This helps certain RCS programs find their peers.
PATHPREFIX = $(abs_top_builddir)/src
@@ -36,15 +39,19 @@ TESTS = \
t030 \
t050 \
t150 \
+ t151 \
t153 \
t160 \
t180 \
+ t181 \
t300 \
t301 \
+ t302 \
t310 \
t311 \
t312 \
t313 \
+ t314 \
t320 \
t370 \
t380 \
@@ -58,6 +65,7 @@ TESTS = \
t450 \
t460 \
t470 \
+ t500 \
t510 \
t511 \
t600 \
@@ -80,12 +88,14 @@ TESTS = \
t803 \
t804 \
t805 \
+ t806 \
+ t807 \
t810 \
t900 \
t999
EXTRA_DIST = $(TESTS) \
- common common-d common-i common-kn \
+ common common-d common-i common-kn common-v \
compgate \
fake
diff --git rcs-5.9.4.orig/tests/README rcs-5.9.4/tests/README
index a3f0076..cd0a719 100644
--- rcs-5.9.4.orig/tests/README
+++ rcs-5.9.4/tests/README
@@ -100,7 +100,7 @@ For rlog tests, use the RCS files in fake/ and direct text manipulation
-Copyright (C) 2010-2015 Thien-Thi Nguyen
+Copyright (C) 2010-2017 Thien-Thi Nguyen
Copying and distribution of this file, with or without modification,
are permitted provided the copyright notice and this notice are preserved.
diff --git rcs-5.9.4.orig/tests/btdt.c rcs-5.9.4/tests/btdt.c
index 121c93f..35a88bf 100644
--- rcs-5.9.4.orig/tests/btdt.c
+++ rcs-5.9.4/tests/btdt.c
@@ -1,6 +1,6 @@
/* btdt.c --- been there done that
- Copyright (C) 2010-2015 Thien-Thi Nguyen
+ Copyright (C) 2010-2017 Thien-Thi Nguyen
This file is part of GNU RCS.
@@ -165,7 +165,7 @@ main (int argc, char *argv[VLA_ELEMS (argc)])
if (STR_SAME ("--version", argv[1]))
{
printf ("btdt (%s) %s\n", PACKAGE_NAME, PACKAGE_VERSION);
- printf ("Copyright (C) 2010-2015 Thien-Thi Nguyen\n");
+ printf ("Copyright (C) 2010-2017 Thien-Thi Nguyen\n");
printf ("License GPLv3+; GNU GPL version 3 or later"
" <http://gnu.org/licenses/gpl.html>\n\n");
argv[1] = "--help";
diff --git rcs-5.9.4.orig/tests/common rcs-5.9.4/tests/common
index de23701..6a8b2b1 100644
--- rcs-5.9.4.orig/tests/common
+++ rcs-5.9.4/tests/common
@@ -1,6 +1,6 @@
# common variables / subroutines / load-time actions
-# Copyright (C) 2010-2015 Thien-Thi Nguyen
+# Copyright (C) 2010-2017 Thien-Thi Nguyen
#
# This file is part of GNU RCS.
#
diff --git rcs-5.9.4.orig/tests/common-d rcs-5.9.4/tests/common-d
index 7177834..e2e9d6e 100644
--- rcs-5.9.4.orig/tests/common-d
+++ rcs-5.9.4/tests/common-d
@@ -1,6 +1,6 @@
# common-d (date testing) variables / subroutines / load-time actions
-# Copyright (C) 2011-2015 Thien-Thi Nguyen
+# Copyright (C) 2011-2017 Thien-Thi Nguyen
#
# This file is part of GNU RCS.
#
diff --git rcs-5.9.4.orig/tests/common-i rcs-5.9.4/tests/common-i
index f5b85fb..14777d0 100644
--- rcs-5.9.4.orig/tests/common-i
+++ rcs-5.9.4/tests/common-i
@@ -1,6 +1,6 @@
# common-i (init testing) variables / subroutines / load-time actions
-# Copyright (C) 2010-2015 Thien-Thi Nguyen
+# Copyright (C) 2010-2017 Thien-Thi Nguyen
#
# This file is part of GNU RCS.
#
diff --git rcs-5.9.4.orig/tests/common-kn rcs-5.9.4/tests/common-kn
index fdd1bdc..58f6ff4 100644
--- rcs-5.9.4.orig/tests/common-kn
+++ rcs-5.9.4/tests/common-kn
@@ -1,6 +1,6 @@
# common-kn (kw normalization) variables / subroutines
-# Copyright (C) 2010-2015 Thien-Thi Nguyen
+# Copyright (C) 2010-2017 Thien-Thi Nguyen
#
# This file is part of GNU RCS.
#
diff --git rcs-5.9.4/tests/common-v rcs-5.9.4/tests/common-v
new file mode 100644
index 0000000..419eac9
--- /dev/null
+++ rcs-5.9.4/tests/common-v
@@ -0,0 +1,51 @@
+# common-v (versioning) variables / subroutines
+
+# Copyright (C) 2016, 2017 Thien-Thi Nguyen
+#
+# This file is part of GNU RCS.
+#
+# GNU RCS is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# GNU RCS is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty
+# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# (shell-script-mode)
+
+# variables
+
+# Look at the last "word" on the first line of rcs --version output.
+ver=`rcs --version 2>&1 | sed -e 's/.* //' -e 1q`
+
+# RCS 5.7 and earlier do not support --version, displaying instead:
+# rcs: unknown option: --version
+# In that case, try again w/ -V.
+test x"$ver" = x--version \
+ && ver=`rcs -V 2>&1 | sed -e 's/.* //' -e 1q`
+
+# functions
+
+vsort ()
+{
+ # Poor man's sort -V.
+ # Thanks autotools! Long live GNU coreutils!
+ # (grep "grep -nHFe 'sort -' ../configure")
+ sort -t '.' -n -k1,1 -k2,2 -k3,3 -k4,4 -k5,5
+}
+
+version_at_least ()
+{
+ # $1 -- minimal version number (MAJOR.MINOR or MAJOR.MINOR.PATCH)
+ minver=$1
+ first=`printf '%s\n%s\n' $ver $minver | vsort | sed 1q`
+ test x"$first" = x"$minver"
+}
+
+# common-v ends here
diff --git rcs-5.9.4.orig/tests/compgate rcs-5.9.4/tests/compgate
index df4ee92..e65a6eb 100644
--- rcs-5.9.4.orig/tests/compgate
+++ rcs-5.9.4/tests/compgate
@@ -1,6 +1,6 @@
# compgate --- a -*-shell-script-*- fragment to skip component tests, maybe
-# Copyright (C) 2010-2015 Thien-Thi Nguyen
+# Copyright (C) 2010-2017 Thien-Thi Nguyen
#
# This file is part of GNU RCS.
#
diff --git rcs-5.9.4.orig/tests/fake/b.make rcs-5.9.4/tests/fake/b.make
index fda521d..c5c75fb 100755
--- rcs-5.9.4.orig/tests/fake/b.make
+++ rcs-5.9.4/tests/fake/b.make
@@ -1,7 +1,7 @@
#!/bin/sh
# b.make --- make b and b.d/*
-# Copyright (C) 2010-2015 Thien-Thi Nguyen
+# Copyright (C) 2010-2017 Thien-Thi Nguyen
#
# This file is part of GNU RCS.
#
diff --git rcs-5.9.4/tests/fake/nul-in-ed-script rcs-5.9.4/tests/fake/nul-in-ed-script
new file mode 100644
index 0000000..af9144f
Binary files /dev/null and rcs-5.9.4/tests/fake/nul-in-ed-script differ
diff --git rcs-5.9.4/tests/fake/nul-in-ed-script.GNUmakefile rcs-5.9.4/tests/fake/nul-in-ed-script.GNUmakefile
new file mode 100644
index 0000000..312b2c3
--- /dev/null
+++ rcs-5.9.4/tests/fake/nul-in-ed-script.GNUmakefile
@@ -0,0 +1,65 @@
+# nul-in-ed-script.GNUmakefile --- make nul-in-ed-script
+
+# Copyright (C) 2016, 2017 Thien-Thi Nguyen
+#
+# This file is part of GNU RCS.
+#
+# GNU RCS is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# GNU RCS is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty
+# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+w = nul-in-ed-script
+v = $(w),v
+
+quiet = -q
+
+mogrify = printf $(1) > $(w)
+checkin = ci $(quiet) -l -m'$(1)' $(w) $(v)
+
+$(w): prep 1.1 1.2 done
+
+prep:
+ rm -f $(w) $(v)
+ touch $(w)
+ rcs $(quiet) -i -t- $(w) $(v)
+
+# Initial commit:
+# |^@ (actually: single NUL on its own line)
+# |two
+# |three
+1.1:
+ $(call mogrify, \\0\\ntwo\\nthree\\n)
+ $(call checkin, A)
+
+# Second commit, comprising a change in two lines (1 and 3):
+# |one
+# |two
+# |THREE
+#
+# This essentially sets up x,v to contain frag:
+# |text
+# |@d1 1
+# |a1 1
+# |^@ (actually: single NUL on its own line)
+# |d3 1
+# |a3 1
+# |three
+# |@
+1.2:
+ $(call mogrify, one\\ntwo\\nTHREE\\n)
+ $(call checkin, B)
+
+done:
+ rcs $(quiet) -u $(v)
+ mv -f $(v) $(w)
+
+# nul-in-ed-script.GNUmakefile ends here
diff --git rcs-5.9.4.orig/tests/fake/stdio-sync.GNUmakefile rcs-5.9.4/tests/fake/stdio-sync.GNUmakefile
index b58a4d5..9cf3daa 100644
--- rcs-5.9.4.orig/tests/fake/stdio-sync.GNUmakefile
+++ rcs-5.9.4/tests/fake/stdio-sync.GNUmakefile
@@ -1,6 +1,6 @@
# stdio-sync.GNUmakefile --- make stdio-sync
-# Copyright (C) 2010-2015 Thien-Thi Nguyen
+# Copyright (C) 2010-2017 Thien-Thi Nguyen
#
# This file is part of GNU RCS.
#
diff --git rcs-5.9.4.orig/tests/fake/two rcs-5.9.4/tests/fake/two
index ca9604c..5ff6370 100644
--- rcs-5.9.4.orig/tests/fake/two
+++ rcs-5.9.4/tests/fake/two
@@ -25,14 +25,14 @@ log
@ANOTHER
@
text
-@nonempty
-morejunk
+@non@@empty
+more@@junk
@
4.20
log
-@HELLO
+@HELLO@@THERE
@
text
@d2 1
diff --git rcs-5.9.4.orig/tests/known-failures.in rcs-5.9.4/tests/known-failures.in
index c30024b..aad4977 100755
--- rcs-5.9.4.orig/tests/known-failures.in
+++ rcs-5.9.4/tests/known-failures.in
@@ -1,5 +1,5 @@
#!/bin/sh
-# Copyright (C) 2010-2015 Thien-Thi Nguyen
+# Copyright (C) 2010-2017 Thien-Thi Nguyen
#
# This file is part of GNU RCS.
#
@@ -99,6 +99,7 @@ exit 0
t300 ; trailing junk incorrectly ignored
t311 ; cannot handle [0-9]+ for state, author
t313 ; rlog omits trailing newline for midline description
+ t314 ; rlog w/ various date-selection, timezone-output options
t608 ; rcs -m: barfs on empty log message (made optional in 5.8)
t800 ; outdate everything leaves non-empty RCS file (fixed in 5.8)
t801 ; ci -dYYYY-DOW => "invalid date/time format" (fixed in 5.8)
@@ -106,34 +107,58 @@ exit 0
* 5.8
t301 ; integrity syntax underspecified (fixed in 5.8.2)
+ t314 ; rlog w/ various date-selection, timezone-output options
t320 ; rlog -zLT => uninitialized struct tm (fixed in 5.8.1)
; NB: test fails reliably only for x86-64 -- YMMV!
t370 ; rlog -dD1<D2 => debugging output to stderr (fixed in 5.8.1)
t803 ; sym deref w/ common prefix (fixed in 5.8.2)
t804 ; revert on unchanged on a branch (fixed in 5.9.3)
t810 ; ci -l -d -T => RCS file mtime set to epoch (fixed in 5.8.1)
+ t806 ; invalid RCS file: missing string for desc, log, text (fixed in 5.9.5)
+ t807 ; rlog +/- summation w/ NUL in ed script
* 5.8.1
t301 ; integrity syntax underspecified (fixed in 5.8.2)
+ t314 ; rlog w/ various date-selection, timezone-output options
t803 ; sym deref w/ common prefix (fixed in 5.8.2)
t804 ; revert on unchanged on a branch (fixed in 5.9.3)
+ t806 ; invalid RCS file: missing string for desc, log, text (fixed in 5.9.5)
+ t807 ; rlog +/- summation w/ NUL in ed script
* 5.8.2
+ t314 ; rlog w/ various date-selection, timezone-output options
t804 ; revert on unchanged on a branch (fixed in 5.9.3)
+ t806 ; invalid RCS file: missing string for desc, log, text (fixed in 5.9.5)
+ t807 ; rlog +/- summation w/ NUL in ed script
* 5.9.0
+ t314 ; rlog w/ various date-selection, timezone-output options
t804 ; revert on unchanged on a branch (fixed in 5.9.3)
+ t806 ; invalid RCS file: missing string for desc, log, text (fixed in 5.9.5)
+ t807 ; rlog +/- summation w/ NUL in ed script
* 5.9.1
+ t314 ; rlog w/ various date-selection, timezone-output options
t804 ; revert on unchanged on a branch (fixed in 5.9.3)
+ t806 ; invalid RCS file: missing string for desc, log, text (fixed in 5.9.5)
+ t807 ; rlog +/- summation w/ NUL in ed script
* 5.9.2
+ t314 ; rlog w/ various date-selection, timezone-output options
t804 ; revert on unchanged on a branch (fixed in 5.9.3)
+ t806 ; invalid RCS file: missing string for desc, log, text (fixed in 5.9.5)
+ t807 ; rlog +/- summation w/ NUL in ed script
* 5.9.3
+ t314 ; rlog w/ various date-selection, timezone-output options
;; t805 under OSX (see "bletcherous hack" above)
+ t806 ; invalid RCS file: missing string for desc, log, text (fixed in 5.9.5)
+ t807 ; rlog +/- summation w/ NUL in ed script
* 5.9.4
+ t314 ; rlog w/ various date-selection, timezone-output options
+ t806 ; invalid RCS file: missing string for desc, log, text (fixed in 5.9.5)
+ t807 ; rlog +/- summation w/ NUL in ed script
* end matter
*** Local variables:
diff --git rcs-5.9.4.orig/tests/t010 rcs-5.9.4/tests/t010
index 0421690..a709902 100644
--- rcs-5.9.4.orig/tests/t010
+++ rcs-5.9.4/tests/t010
@@ -1,6 +1,6 @@
# t010 --- btdt --version / --help
#
-# Copyright (C) 2010-2015 Thien-Thi Nguyen
+# Copyright (C) 2010-2017 Thien-Thi Nguyen
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
diff --git rcs-5.9.4.orig/tests/t030 rcs-5.9.4/tests/t030
index e5cd728..fda4527 100644
--- rcs-5.9.4.orig/tests/t030
+++ rcs-5.9.4/tests/t030
@@ -1,6 +1,6 @@
# t030 --- C function getoldkeys
#
-# Copyright (C) 2010-2015 Thien-Thi Nguyen
+# Copyright (C) 2010-2017 Thien-Thi Nguyen
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
@@ -30,6 +30,11 @@ doubt=$wd/g.diff
$hey echo ' -*- org -*-'
+# Sanity check (and coverage booster :-D).
+cmd='./btdt getoldkeys'
+eval $cmd \
+ && problem "$cmd did not fail"
+
try ()
{
# $1 -- filename
diff --git rcs-5.9.4.orig/tests/t050 rcs-5.9.4/tests/t050
index ce34bfc..07e4858 100644
--- rcs-5.9.4.orig/tests/t050
+++ rcs-5.9.4/tests/t050
@@ -1,6 +1,6 @@
# t050 --- C function grok_all maintains correct edits order
#
-# Copyright (C) 2010-2015 Thien-Thi Nguyen
+# Copyright (C) 2010-2017 Thien-Thi Nguyen
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
diff --git rcs-5.9.4.orig/tests/t150 rcs-5.9.4/tests/t150
index 1db9f78..bbe9cab 100644
--- rcs-5.9.4.orig/tests/t150
+++ rcs-5.9.4/tests/t150
@@ -1,6 +1,6 @@
-# t150 --- availability to shell, --version / --help
+# t150 --- availability to shell, --version / --help / -V
#
-# Copyright (C) 2010-2015 Thien-Thi Nguyen
+# Copyright (C) 2010-2017 Thien-Thi Nguyen
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
@@ -51,4 +51,74 @@ for p in $programs ; do
grep -F 'Report bugs to' $hout || say_what $hcmd
done
+##
+# Check that each program fails when given --no-such-option.
+##
+
+for p in $programs ; do
+ $p --no-such-option \
+ && problem "$p --no-such-option did not fail"
+done
+
+##
+# For RCS 5.9.0 and later, check rcs no-such-command and
+# rcs --help COMMAND where COMMAND ∉ {ident, merge, rcs}.
+##
+
+. $srcdir/common-v
+version_at_least 5.9.0 || exit 0
+
+rcs no-such-command \
+ && problem "rcs no-such-command did not fail"
+
+for p in $programs ; do
+ case $p in
+ ident|merge|rcs) continue ;;
+ esac
+ hcmd="rcs --help $p"
+ hout=$wd/help-$p
+ must '$hcmd | diff $hout -'
+done
+
+##
+# For RCS 5.9.0 and later, check that rcs -V produces a warning.
+##
+
+rout=$wd/rout
+rerr=$wd/rerr
+cmd='rcs -V'
+must '$cmd 1>$rout 2>$rerr'
+silence_means_death $rout "$cmd"
+silence_means_death $rerr "$cmd"
+grep obsolete $rerr 1>/dev/null \
+ || problem 'invalid diagnostic'
+
+##
+# For RCS 5.9.0 and later, check that rlog -V2 and rlog -V5X
+# (on a valid RCS file) produce range and type errors, respectively.
+##
+
+cp -f `bundled_commav empty` $v
+set +e
+
+flail ()
+{
+ # $1 -- arg for rlog -V
+ # $2 -- pattern to grep for
+ cmd="rlog -V$1"
+ pattern="$2"
+
+ $cmd $v 1>$rout 2>$rerr \
+ && problem "$cmd did not fail"
+ silence_means_death $rerr "$cmd"
+ noiselessness_rules $rout "$cmd"
+ grep "$pattern" $rerr 1>/dev/null \
+ || problem 'invalid diagnostic'
+}
+
+flail 2 out.of.range
+flail 5X isn.t.a.number
+
+exit 0
+
# t150 ends here
diff --git rcs-5.9.4/tests/t151 rcs-5.9.4/tests/t151
new file mode 100644
index 0000000..413d949
--- /dev/null
+++ rcs-5.9.4/tests/t151
@@ -0,0 +1,44 @@
+# t151 --- rcs --commands and rcs --aliases
+#
+# Copyright (C) 2016, 2017 Thien-Thi Nguyen
+#
+# This program is free software: you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation, either version 3 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty
+# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+. $srcdir/common
+split_std_out_err
+$hey set -x
+
+##
+# These options were introduced in RCS 5.9.0.
+# (Skip the test for prior versions.)
+##
+. $srcdir/common-v
+version_at_least 5.9.0 || exit 77
+
+try ()
+{
+ # $1 -- option (without leading "--")
+ opt=$1
+ cmd="rcs --$opt"
+ must '$cmd > $wd/$opt'
+ silence_means_death $wd/$opt "$cmd"
+ noiselessness_rules $wd/out "$cmd"
+}
+
+try commands
+try aliases
+
+exit 0
+
+# t151 ends here
diff --git rcs-5.9.4.orig/tests/t153 rcs-5.9.4/tests/t153
index 73c5b6a..b13def5 100644
--- rcs-5.9.4.orig/tests/t153
+++ rcs-5.9.4/tests/t153
@@ -1,6 +1,6 @@
# t153 --- inaccessible TMPDIR
#
-# Copyright (C) 2013-2015 Thien-Thi Nguyen
+# Copyright (C) 2013-2017 Thien-Thi Nguyen
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
diff --git rcs-5.9.4.orig/tests/t160 rcs-5.9.4/tests/t160
index dea82b6..d2eaf0b 100644
--- rcs-5.9.4.orig/tests/t160
+++ rcs-5.9.4/tests/t160
@@ -1,6 +1,6 @@
# t160 --- rcsdiff
#
-# Copyright (C) 2010-2015 Thien-Thi Nguyen
+# Copyright (C) 2010-2017 Thien-Thi Nguyen
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
@@ -242,8 +242,8 @@ if diff --help | grep -e '--unified' ; then
--- t160.d/two 2010/10/02 16:41:32 4.20
+++ t160.d/two 2010/10/02 16:41:32 4.21
@@ -1 +1,2 @@
- nonempty
-+morejunk
+ non@empty
++more@junk
EOF
diff $wd/rcsdiff.out $wd/expected > $wd/diff.out
noiselessness_rules $wd/diff.out 'rcsdiff produced the wrong output'
@@ -251,6 +251,16 @@ else
$hey echo '(skipped)'
fi
+##
+# * For "slightly binary" files (not -kb but with embedded NUL),
+# check for exit value 2.
+##
+
+$hey echo '* slightly binary'
+must 'cp -f `bundled_commav nul-in-ed-script` $v'
+must 'co -u $w'
+ev 2 -r1.1
+
exit 0
# t160 ends here
diff --git rcs-5.9.4.orig/tests/t180 rcs-5.9.4/tests/t180
index 2940e18..dc52e23 100644
--- rcs-5.9.4.orig/tests/t180
+++ rcs-5.9.4/tests/t180
@@ -1,6 +1,6 @@
# t180 --- merge -p
#
-# Copyright (C) 2010-2015 Thien-Thi Nguyen
+# Copyright (C) 2010-2017 Thien-Thi Nguyen
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
diff --git rcs-5.9.4/tests/t181 rcs-5.9.4/tests/t181
new file mode 100644
index 0000000..ea88906
--- /dev/null
+++ rcs-5.9.4/tests/t181
@@ -0,0 +1,58 @@
+# t181 --- merge(1) w/ invalid options, arguments
+#
+# Copyright (C) 2016, 2017 Thien-Thi Nguyen
+#
+# This program is free software: you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation, either version 3 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty
+# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+. $srcdir/common
+. $srcdir/common-v
+split_std_out_err
+$hey set -x
+
+##
+# Check that various invalid command-lines do indeed fail.
+##
+
+flail ()
+{
+ # $@ -- command-line args to merge(1)
+ merge "$@" \
+ && problem 'merge '"$@"' did not fail'
+}
+
+flail -A -E
+flail -E -A
+flail -A -e
+flail -e -A
+flail -E -e
+flail -e -E
+
+flail -L
+flail -L A -L B -L C -L D
+
+flail 1 2 3 4
+
+##
+# For RCS 5.9.0 and later, check behavior of
+# merge -V and merge -VN.
+##
+
+if version_at_least 5.9.0 ; then
+ flail -V5
+ must 'merge -V'
+fi
+
+exit 0
+
+# t181 ends here
diff --git rcs-5.9.4.orig/tests/t300 rcs-5.9.4/tests/t300
index cde2c74..278032f 100644
--- rcs-5.9.4.orig/tests/t300
+++ rcs-5.9.4/tests/t300
@@ -1,6 +1,6 @@
# t300 --- rlog on invalid RCS file
#
-# Copyright (C) 2010-2015 Thien-Thi Nguyen
+# Copyright (C) 2010-2017 Thien-Thi Nguyen
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
@@ -64,6 +64,15 @@ barf 'bad keyword in header' \
barf 'missing author value in header' \
'sed 10s/.ttn// `bundled_commav zblob` > $v'
+barf 'invalid substitution mode' \
+ 'sed 6s/b/BAD/ `bundled_commav zblob` > $v'
+
+barf 'head names a non-existent revision' \
+ 'sed 1s/1/2/g `bundled_commav one` > $v'
+
+barf 'spurious edits w/o corresponding index' \
+ 'sed "20s/1.7/1.6/;22,26d" `bundled_commav b.d/1612,v` > $v'
+
zinvasion ()
{
# $1 -- RCS file
diff --git rcs-5.9.4.orig/tests/t301 rcs-5.9.4/tests/t301
index de03d47..0f9b2b7 100644
--- rcs-5.9.4.orig/tests/t301
+++ rcs-5.9.4/tests/t301
@@ -1,6 +1,6 @@
# t301 --- rlog on RCS file w/ bad integrity
#
-# Copyright (C) 2013-2015 Thien-Thi Nguyen
+# Copyright (C) 2013-2017 Thien-Thi Nguyen
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
diff --git rcs-5.9.4/tests/t302 rcs-5.9.4/tests/t302
new file mode 100644
index 0000000..1c58489
--- /dev/null
+++ rcs-5.9.4/tests/t302
@@ -0,0 +1,40 @@
+# t302 --- warning for lock held on non-existent revision
+#
+# Copyright (C) 2016, 2017 Thien-Thi Nguyen
+#
+# This program is free software: you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation, either version 3 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty
+# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+##
+# Check that rlog warns when a user holds a lock
+# to a non-existent revision.
+##
+
+. $srcdir/common
+split_std_out_err
+
+rerr=$wd/rerr
+
+must 'sed 5s/1/2/g `bundled_commav b.d/11,v` > $v'
+must 'rlog $v 2>$rerr'
+
+test -s $rerr \
+ || problem 'no diagnostic output'
+
+grep 'warning: user.*holds.*lock.*non-existent revision' \
+ $rerr 1>/dev/null \
+ || problem 'incorrect diagnostic'
+
+exit 0
+
+# t302 ends here
diff --git rcs-5.9.4.orig/tests/t310 rcs-5.9.4/tests/t310
index 7e62185..1bf789d 100644
--- rcs-5.9.4.orig/tests/t310
+++ rcs-5.9.4/tests/t310
@@ -1,6 +1,6 @@
# t310 --- rlog on valid RCS file
#
-# Copyright (C) 2010-2015 Thien-Thi Nguyen
+# Copyright (C) 2010-2017 Thien-Thi Nguyen
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
@@ -40,6 +40,12 @@ norm 'single-entry' `bundled_commav one`
norm 'two-entry' `bundled_commav two`
norm '2-entry with branches' `bundled_commav two`
+must "sed '25s/ANOTHER/@/;26d' $v > $v-T"
+norm '2-entry w/ empty log' $v-T
+elm='empty log message'
+grep -F "$elm" $rout \
+ || problem "missing \"$elm\" output"
+
##
# Check rlog on a CVS-created ,v (with commitid keywords).
##
diff --git rcs-5.9.4.orig/tests/t311 rcs-5.9.4/tests/t311
index 886c586..dfa4144 100644
--- rcs-5.9.4.orig/tests/t311
+++ rcs-5.9.4/tests/t311
@@ -1,6 +1,6 @@
# t311 --- rlog (parsing in general) accepts numeric state, author
#
-# Copyright (C) 2010-2015 Thien-Thi Nguyen
+# Copyright (C) 2010-2017 Thien-Thi Nguyen
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
diff --git rcs-5.9.4.orig/tests/t312 rcs-5.9.4/tests/t312
index 3e33627..7111c4d 100644
--- rcs-5.9.4.orig/tests/t312
+++ rcs-5.9.4/tests/t312
@@ -1,6 +1,6 @@
# t312 --- rlog outputs midline-ending log messages with trailing newline
#
-# Copyright (C) 2011-2015 Thien-Thi Nguyen
+# Copyright (C) 2011-2017 Thien-Thi Nguyen
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
diff --git rcs-5.9.4.orig/tests/t313 rcs-5.9.4/tests/t313
index ee153a0..d4d4cde 100644
--- rcs-5.9.4.orig/tests/t313
+++ rcs-5.9.4/tests/t313
@@ -1,6 +1,6 @@
# t313 --- rlog outputs midline-ending description with trailing newline
#
-# Copyright (C) 2011-2015 Thien-Thi Nguyen
+# Copyright (C) 2011-2017 Thien-Thi Nguyen
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
diff --git rcs-5.9.4/tests/t314 rcs-5.9.4/tests/t314
new file mode 100644
index 0000000..c6e1518
--- /dev/null
+++ rcs-5.9.4/tests/t314
@@ -0,0 +1,291 @@
+# t314 --- rlog w/ various date-selection, timezone-output options
+#
+# Copyright (C) 2016, 2017 Thien-Thi Nguyen
+#
+# This program is free software: you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation, either version 3 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty
+# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+. $srcdir/common
+split_std_out_err no
+unset TZ
+
+$hey echo ' -*- org -*-'
+
+exp=$wd/exp
+got=$wd/got
+
+get ()
+{
+ # $1 -- filename of bundled ,v to use
+ sel=$1
+
+ $hey echo "* with $sel"
+ must "cp -f `bundled_commav $sel` $v"
+}
+
+try ()
+{
+ # $1 -- title
+ # $2 -- options
+ # $3 -- expected date-portion output (can be multiline)
+ title="$1"
+ options="$2"
+ expected="$3"
+
+ $hey echo "*** $title ($options)"
+ if [ -z "$expected" ] ; then
+ >$exp
+ else
+ printf '%s\n' $expected | sed 's/=/ /' >$exp
+ fi
+ eval rlog $options $v \
+ | sed '/^date: /!d;s///;s/;.*//' \
+ >$got
+
+ $hey sed 's/^/ /' $got
+ diff -u $exp $got \
+ || say_what "$title ($options)"
+
+}
+
+flail ()
+{
+ # $1 -- options
+ # $2 -- fragment of expected error output (diagnostic)
+ options="$1"
+ diagnostic="$2"
+
+ eval rlog $options $v 2>$wd/rout \
+ && problem "rlog $options did not fail"
+ grep "$diagnostic" $wd/rout \
+ || problem "could not find diagnostic frag: $diagnostic"
+}
+
+##
+# Check invalid -d and -z option on an empty RCS file.
+##
+
+get empty
+
+flail '-zNOSUCH' 'not a known time zone'
+flail '-dNOSUCH' 'unknown date/time'
+
+##
+# Check various -d and -z options on a one-revision RCS file.
+##
+
+get one
+
+try 'no date or time-zone options' \
+ '' '
+2010/10/02=04:35:26
+'
+
+try 'before 2016' \
+ '-d2016' '
+2010/10/02=04:35:26
+'
+
+try 'before 2010' \
+ '-d2010' ''
+
+try 'precisely the earliest date' \
+ '-d"2010/10/02 04:35:26"' '
+2010/10/02=04:35:26
+'
+
+try 'precisely one second before the earliest date' \
+ '-d"October 2, 2010 04:35:25"' ''
+
+try 'time-zone "+0000"' \
+ '-z+0000' '
+2010-10-02=04:35:26+00
+'
+
+try 'time-zone "-0000"' \
+ '-z-0000' '
+2010-10-02=04:35:26+00
+'
+
+try 'time zone "-1000"' \
+ '-z-1000' '
+2010-10-01=18:35:26-10
+'
+
+try 'time zone "+1100"' \
+ '-z+1100' '
+2010-10-02=15:35:26+11
+'
+
+try 'time zone "UTC"' \
+ '-zUTC' '
+2010-10-02=04:35:26+00
+'
+
+##
+# Same checks, using an RCS file w/ more revisions.
+##
+
+get b.d/1117,v
+
+try 'no date or time-zone options' \
+ '' '
+2010/04/18=09:39:02
+2010/04/12=13:23:04
+2010/04/12=13:20:50
+2010/04/12=12:16:58
+2010/03/30=09:46:50
+2010/03/30=09:46:24
+2010/03/30=09:45:42
+2010/03/30=09:45:02
+2010/03/17=09:00:17
+2010/03/28=16:04:26
+2010/03/18=06:22:00
+2010/03/18=06:21:03
+2010/03/18=06:12:32
+2010/03/17=09:11:48
+2010/03/17=09:01:43
+2010/03/17=09:01:43
+'
+
+try 'before 2016' \
+ '-d2016' '
+2010/04/18=09:39:02
+'
+
+try 'before 2010' \
+ '-d2010' ''
+
+try 'precisely the earliest date' \
+ '-d"2010/03/17 09:00:17"' '
+2010/03/17=09:00:17
+'
+
+try 'precisely one second before the earliest date' \
+ '-d"March 17, 2010 09:00:16"' ''
+
+try 'time-zone "+0000"' \
+ '-z+0000' '
+2010-04-18=09:39:02+00
+2010-04-12=13:23:04+00
+2010-04-12=13:20:50+00
+2010-04-12=12:16:58+00
+2010-03-30=09:46:50+00
+2010-03-30=09:46:24+00
+2010-03-30=09:45:42+00
+2010-03-30=09:45:02+00
+2010-03-17=09:00:17+00
+2010-03-28=16:04:26+00
+2010-03-18=06:22:00+00
+2010-03-18=06:21:03+00
+2010-03-18=06:12:32+00
+2010-03-17=09:11:48+00
+2010-03-17=09:01:43+00
+2010-03-17=09:01:43+00
+'
+
+try 'time-zone "-0000"' \
+ '-z-0000' '
+2010-04-18=09:39:02+00
+2010-04-12=13:23:04+00
+2010-04-12=13:20:50+00
+2010-04-12=12:16:58+00
+2010-03-30=09:46:50+00
+2010-03-30=09:46:24+00
+2010-03-30=09:45:42+00
+2010-03-30=09:45:02+00
+2010-03-17=09:00:17+00
+2010-03-28=16:04:26+00
+2010-03-18=06:22:00+00
+2010-03-18=06:21:03+00
+2010-03-18=06:12:32+00
+2010-03-17=09:11:48+00
+2010-03-17=09:01:43+00
+2010-03-17=09:01:43+00
+'
+
+try 'time zone "-1000"' \
+ '-z-1000' '
+2010-04-17=23:39:02-10
+2010-04-12=03:23:04-10
+2010-04-12=03:20:50-10
+2010-04-12=02:16:58-10
+2010-03-29=23:46:50-10
+2010-03-29=23:46:24-10
+2010-03-29=23:45:42-10
+2010-03-29=23:45:02-10
+2010-03-16=23:00:17-10
+2010-03-28=06:04:26-10
+2010-03-17=20:22:00-10
+2010-03-17=20:21:03-10
+2010-03-17=20:12:32-10
+2010-03-16=23:11:48-10
+2010-03-16=23:01:43-10
+2010-03-16=23:01:43-10
+'
+
+try 'time zone "+1100"' \
+ '-z+1100' '
+2010-04-18=20:39:02+11
+2010-04-13=00:23:04+11
+2010-04-13=00:20:50+11
+2010-04-12=23:16:58+11
+2010-03-30=20:46:50+11
+2010-03-30=20:46:24+11
+2010-03-30=20:45:42+11
+2010-03-30=20:45:02+11
+2010-03-17=20:00:17+11
+2010-03-29=03:04:26+11
+2010-03-18=17:22:00+11
+2010-03-18=17:21:03+11
+2010-03-18=17:12:32+11
+2010-03-17=20:11:48+11
+2010-03-17=20:01:43+11
+2010-03-17=20:01:43+11
+'
+
+try 'time-zone "UTC"' \
+ '-zUTC' '
+2010-04-18=09:39:02+00
+2010-04-12=13:23:04+00
+2010-04-12=13:20:50+00
+2010-04-12=12:16:58+00
+2010-03-30=09:46:50+00
+2010-03-30=09:46:24+00
+2010-03-30=09:45:42+00
+2010-03-30=09:45:02+00
+2010-03-17=09:00:17+00
+2010-03-28=16:04:26+00
+2010-03-18=06:22:00+00
+2010-03-18=06:21:03+00
+2010-03-18=06:12:32+00
+2010-03-17=09:11:48+00
+2010-03-17=09:01:43+00
+2010-03-17=09:01:43+00
+'
+
+##
+# Check ranges (i.e., with < and > in -dSPEC).
+##
+
+try 'range 2010-03-17 to 2010-03-18' \
+ '-d"2010-03-17<2010-03-18"' '
+2010/03/17=09:00:17
+2010/03/17=09:11:48
+2010/03/17=09:01:43
+2010/03/17=09:01:43
+'
+
+exit 0
+
+# t314 ends here
diff --git rcs-5.9.4.orig/tests/t320 rcs-5.9.4/tests/t320
index 830eca4..375bf71 100644
--- rcs-5.9.4.orig/tests/t320
+++ rcs-5.9.4/tests/t320
@@ -1,6 +1,6 @@
# t320 --- rlog -zLT regression
#
-# Copyright (C) 2011-2015 Thien-Thi Nguyen
+# Copyright (C) 2011-2017 Thien-Thi Nguyen
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
diff --git rcs-5.9.4.orig/tests/t370 rcs-5.9.4/tests/t370
index 17938eb..396030d 100644
--- rcs-5.9.4.orig/tests/t370
+++ rcs-5.9.4/tests/t370
@@ -1,6 +1,6 @@
# t370 --- rlog w/ various (-r, -l, -w, -s, -d) filters
#
-# Copyright (C) 2013-2015 Thien-Thi Nguyen
+# Copyright (C) 2013-2017 Thien-Thi Nguyen
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
diff --git rcs-5.9.4.orig/tests/t380 rcs-5.9.4/tests/t380
index c41662e..08e74cf 100644
--- rcs-5.9.4.orig/tests/t380
+++ rcs-5.9.4/tests/t380
@@ -1,6 +1,6 @@
-# t380 --- rlog reports "keyword substitutation: b"
+# t380 --- rlog reports "keyword substitution: b"
#
-# Copyright (C) 2011-2015 Thien-Thi Nguyen
+# Copyright (C) 2011-2017 Thien-Thi Nguyen
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
@@ -19,13 +19,13 @@
split_std_out_err no
##
-# Check that rlog properly reports "keyword substitutation: b".
+# Check that rlog properly reports "keyword substitution: b".
##
must 'cp `bundled_commav zblob` $v'
must 'rlog $v > $wd/rlog.out'
grep 'keyword substitution: b' $wd/rlog.out \
- || problem 'rlog did not report "keyword substitutation: b"'
+ || problem 'rlog did not report "keyword substitution: b"'
exit 0
diff --git rcs-5.9.4.orig/tests/t390 rcs-5.9.4/tests/t390
index 0461587..adc92b4 100644
--- rcs-5.9.4.orig/tests/t390
+++ rcs-5.9.4/tests/t390
@@ -1,6 +1,6 @@
# t390 --- ident
#
-# Copyright (C) 2010-2015 Thien-Thi Nguyen
+# Copyright (C) 2010-2017 Thien-Thi Nguyen
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
@@ -16,6 +16,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
. $srcdir/common
+. $srcdir/common-v
split_std_out_err no
expected=$wd/expected
@@ -114,10 +115,32 @@ $hey echo '* misc. command-line handling'
iout=$wd/i.out
ierr=$wd/i.err
-ident -Z 1>$iout 2>$ierr \
- && problem 'ident did not fail on invalid command-line option'
-noiselessness_rules $iout 'ident -Z'
-silence_means_death $ierr 'ident -Z'
+cmd='ident -q </dev/null'
+$hey echo "*** $cmd"
+eval $cmd 1>$iout 2>$ierr
+noiselessness_rules $iout "$cmd"
+noiselessness_rules $ierr "$cmd"
+
+flail ()
+{
+ # $@ -- command-line args to ident(1)
+ cmd="ident ""$@"
+ $hey echo "*** $cmd"
+ eval $cmd 1>$iout 2>$ierr \
+ && problem "$cmd did not fail"
+ noiselessness_rules $iout "$cmd"
+ silence_means_death $ierr "$cmd"
+ $hey sed 's/^/ E:/' $ierr
+}
+
+flail -Z
+flail -q no-such-file
+flail no-such-file
+
+if version_at_least 5.9.0 ; then
+ flail -V42
+ must 'ident -V'
+fi
exit 0
diff --git rcs-5.9.4.orig/tests/t391 rcs-5.9.4/tests/t391
index c1944d3..c2a5e01 100644
--- rcs-5.9.4.orig/tests/t391
+++ rcs-5.9.4/tests/t391
@@ -1,6 +1,6 @@
# t391 --- ident with Subversion-style keyword syntax
#
-# Copyright (C) 2011-2015 Thien-Thi Nguyen
+# Copyright (C) 2011-2017 Thien-Thi Nguyen
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
diff --git rcs-5.9.4.orig/tests/t400 rcs-5.9.4/tests/t400
index 8f22e4a..c33a580 100644
--- rcs-5.9.4.orig/tests/t400
+++ rcs-5.9.4/tests/t400
@@ -1,6 +1,6 @@
# t400 --- [stdio] editing routines properly copy trailing context
#
-# Copyright (C) 2010-2015 Thien-Thi Nguyen
+# Copyright (C) 2010-2017 Thien-Thi Nguyen
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
diff --git rcs-5.9.4.orig/tests/t410 rcs-5.9.4/tests/t410
index 188cb59..6c8995e 100644
--- rcs-5.9.4.orig/tests/t410
+++ rcs-5.9.4/tests/t410
@@ -1,6 +1,6 @@
# t410 --- co -p
#
-# Copyright (C) 2010-2015 Thien-Thi Nguyen
+# Copyright (C) 2010-2017 Thien-Thi Nguyen
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
diff --git rcs-5.9.4.orig/tests/t420 rcs-5.9.4/tests/t420
index 6f1a9f2..6d423bc 100644
--- rcs-5.9.4.orig/tests/t420
+++ rcs-5.9.4/tests/t420
@@ -1,6 +1,6 @@
# t420 --- co -p -j
#
-# Copyright (C) 2010-2015 Thien-Thi Nguyen
+# Copyright (C) 2010-2017 Thien-Thi Nguyen
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
diff --git rcs-5.9.4.orig/tests/t430 rcs-5.9.4/tests/t430
index aa42d17..2498687 100644
--- rcs-5.9.4.orig/tests/t430
+++ rcs-5.9.4/tests/t430
@@ -1,6 +1,6 @@
# t430 --- co -p -k
#
-# Copyright (C) 2010-2015 Thien-Thi Nguyen
+# Copyright (C) 2010-2017 Thien-Thi Nguyen
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
diff --git rcs-5.9.4.orig/tests/t440 rcs-5.9.4/tests/t440
index 0b6835b..caf534a 100644
--- rcs-5.9.4.orig/tests/t440
+++ rcs-5.9.4/tests/t440
@@ -1,6 +1,6 @@
# t440 --- co -p -w
#
-# Copyright (C) 2010-2015 Thien-Thi Nguyen
+# Copyright (C) 2010-2017 Thien-Thi Nguyen
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
diff --git rcs-5.9.4.orig/tests/t450 rcs-5.9.4/tests/t450
index f246ace..6c93506 100644
--- rcs-5.9.4.orig/tests/t450
+++ rcs-5.9.4/tests/t450
@@ -1,6 +1,6 @@
# t450 --- co -p -s
#
-# Copyright (C) 2010-2015 Thien-Thi Nguyen
+# Copyright (C) 2010-2017 Thien-Thi Nguyen
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
diff --git rcs-5.9.4.orig/tests/t460 rcs-5.9.4/tests/t460
index 3a1fe11..c7a0667 100644
--- rcs-5.9.4.orig/tests/t460
+++ rcs-5.9.4/tests/t460
@@ -1,6 +1,6 @@
# t460 --- co -p -d
#
-# Copyright (C) 2010-2015 Thien-Thi Nguyen
+# Copyright (C) 2010-2017 Thien-Thi Nguyen
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
diff --git rcs-5.9.4.orig/tests/t470 rcs-5.9.4/tests/t470
index bbfbfe8..f5892cc 100644
--- rcs-5.9.4.orig/tests/t470
+++ rcs-5.9.4/tests/t470
@@ -1,6 +1,6 @@
# t470 --- rcsmerge -p -kk
#
-# Copyright (C) 2010-2015 Thien-Thi Nguyen
+# Copyright (C) 2010-2017 Thien-Thi Nguyen
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
diff --git rcs-5.9.4/tests/t500 rcs-5.9.4/tests/t500
new file mode 100644
index 0000000..f76760d
--- /dev/null
+++ rcs-5.9.4/tests/t500
@@ -0,0 +1,56 @@
+# t500 --- does rcs -i -kSUBST set the expand keyword?
+#
+# Copyright (C) 2016, 2017 Thien-Thi Nguyen
+#
+# This program is free software: you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation, either version 3 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty
+# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+. $srcdir/common
+split_std_out_err no
+
+##
+# Check that rcs -i -kSUBST (SUBST ∈ {kvl, k, v, o, b})
+# sets the expand admin-node keyword in the RCS file.
+# When SUBST is kv, however, check that it is NOT set.
+##
+
+try ()
+{
+ # $1 -- substitution mode
+ # $2 -- expected grep result (0: success, 1: failure)
+ k=$1
+ exp=$2
+
+ rm -f $w $v
+ must "rcs -i -t-$k -k$k $w"
+ grep "expand.*@$k@" $v 1>/dev/null
+ res=$?
+ if ! [ $res = $exp ] ; then
+ case $exp in
+ 0) badness='missing' ;;
+ *) badness='spurious' ;;
+ esac
+ bad_RCSfile "$badness @$k@"
+ fi
+}
+
+try kv 1
+try kvl 0
+try k 0
+try v 0
+try o 0
+try b 0
+
+exit 0
+
+# t500 ends here
diff --git rcs-5.9.4.orig/tests/t510 rcs-5.9.4/tests/t510
index 78a27f4..5d5c54a 100644
--- rcs-5.9.4.orig/tests/t510
+++ rcs-5.9.4/tests/t510
@@ -1,6 +1,6 @@
# t510 --- ci -i
#
-# Copyright (C) 2010-2015 Thien-Thi Nguyen
+# Copyright (C) 2010-2017 Thien-Thi Nguyen
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
@@ -42,4 +42,6 @@ triple 'ci -i -w00t'
triple 'ci -i -nomoly'
triple 'ci -i -w00t -nomoly'
+exit 0
+
# t510 ends here
diff --git rcs-5.9.4.orig/tests/t511 rcs-5.9.4/tests/t511
index d9a6566..db4b969 100644
--- rcs-5.9.4.orig/tests/t511
+++ rcs-5.9.4/tests/t511
@@ -1,6 +1,6 @@
# t511 --- ci -iREV -mm
#
-# Copyright (C) 2010-2015 Thien-Thi Nguyen
+# Copyright (C) 2010-2017 Thien-Thi Nguyen
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
@@ -34,4 +34,6 @@ triple 'ci -i4.20 -mOK -w00t'
triple 'ci -i4.20 -mOK -nomoly'
triple 'ci -i4.20 -mOK -w00t -nomoly'
+exit 0
+
# t511 ends here
diff --git rcs-5.9.4.orig/tests/t600 rcs-5.9.4/tests/t600
index ea1b85d..7d89fc3 100644
--- rcs-5.9.4.orig/tests/t600
+++ rcs-5.9.4/tests/t600
@@ -1,6 +1,6 @@
# t600 --- rcs -n updates RCS file
#
-# Copyright (C) 2010-2015 Thien-Thi Nguyen
+# Copyright (C) 2010-2017 Thien-Thi Nguyen
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
diff --git rcs-5.9.4.orig/tests/t601 rcs-5.9.4/tests/t601
index 3699d08..deda12f 100644
--- rcs-5.9.4.orig/tests/t601
+++ rcs-5.9.4/tests/t601
@@ -1,6 +1,6 @@
# t601 --- rcs -a, rcs -e update RCS file
#
-# Copyright (C) 2010-2015 Thien-Thi Nguyen
+# Copyright (C) 2010-2017 Thien-Thi Nguyen
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
diff --git rcs-5.9.4.orig/tests/t602 rcs-5.9.4/tests/t602
index 8e6e4a9..c4c8065 100644
--- rcs-5.9.4.orig/tests/t602
+++ rcs-5.9.4/tests/t602
@@ -1,6 +1,6 @@
# t602 --- both BRNUM and BRNUM. resolve to branch tip
#
-# Copyright (C) 2010-2015 Thien-Thi Nguyen
+# Copyright (C) 2010-2017 Thien-Thi Nguyen
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
diff --git rcs-5.9.4.orig/tests/t603 rcs-5.9.4/tests/t603
index 484fb1d..669c7be 100644
--- rcs-5.9.4.orig/tests/t603
+++ rcs-5.9.4/tests/t603
@@ -1,6 +1,6 @@
# t603 --- rcs -m
#
-# Copyright (C) 2010-2015 Thien-Thi Nguyen
+# Copyright (C) 2010-2017 Thien-Thi Nguyen
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
diff --git rcs-5.9.4.orig/tests/t604 rcs-5.9.4/tests/t604
index cf9c887..b287e2f 100644
--- rcs-5.9.4.orig/tests/t604
+++ rcs-5.9.4/tests/t604
@@ -1,6 +1,6 @@
# t604 --- checkin on a branch with non-strict locking
#
-# Copyright (C) 2010-2015 Thien-Thi Nguyen
+# Copyright (C) 2010-2017 Thien-Thi Nguyen
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
diff --git rcs-5.9.4.orig/tests/t605 rcs-5.9.4/tests/t605
index 98e64af..e8660b1 100644
--- rcs-5.9.4.orig/tests/t605
+++ rcs-5.9.4/tests/t605
@@ -1,6 +1,6 @@
# t605 --- unchanged checkin on branch
#
-# Copyright (C) 2010-2015 Thien-Thi Nguyen
+# Copyright (C) 2010-2017 Thien-Thi Nguyen
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
diff --git rcs-5.9.4.orig/tests/t606 rcs-5.9.4/tests/t606
index 26c7dc7..b3f3ca8 100644
--- rcs-5.9.4.orig/tests/t606
+++ rcs-5.9.4/tests/t606
@@ -1,6 +1,6 @@
# t606 --- lock/unlock with integrity
#
-# Copyright (C) 2011-2015 Thien-Thi Nguyen
+# Copyright (C) 2011-2017 Thien-Thi Nguyen
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
diff --git rcs-5.9.4.orig/tests/t607 rcs-5.9.4/tests/t607
index 101df1e..80424d4 100644
--- rcs-5.9.4.orig/tests/t607
+++ rcs-5.9.4/tests/t607
@@ -1,6 +1,6 @@
# t607 --- rcs -s
#
-# Copyright (C) 2013-2015 Thien-Thi Nguyen
+# Copyright (C) 2013-2017 Thien-Thi Nguyen
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
@@ -38,6 +38,7 @@ xfail ()
xfail
xfail :
xfail :4.20
+xfail `printf '\021\022\023'`:4.20
xfail 'foo bar'
xfail 'foo:bar'
xfail not-a-bad-name-but-a-bad-revision:4.1
diff --git rcs-5.9.4.orig/tests/t608 rcs-5.9.4/tests/t608
index 01ed5ac..3f48bf8 100644
--- rcs-5.9.4.orig/tests/t608
+++ rcs-5.9.4/tests/t608
@@ -1,6 +1,6 @@
# t608 --- rcs -m:
#
-# Copyright (C) 2013-2015 Thien-Thi Nguyen
+# Copyright (C) 2013-2017 Thien-Thi Nguyen
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
diff --git rcs-5.9.4.orig/tests/t609 rcs-5.9.4/tests/t609
index 8aad74d..a6c762c 100644
--- rcs-5.9.4.orig/tests/t609
+++ rcs-5.9.4/tests/t609
@@ -1,6 +1,6 @@
# t609 --- rcs -I -l when already locked by someone else
#
-# Copyright (C) 2013-2015 Thien-Thi Nguyen
+# Copyright (C) 2013-2017 Thien-Thi Nguyen
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
diff --git rcs-5.9.4.orig/tests/t620 rcs-5.9.4/tests/t620
index 7dc0df5..f38da46 100644
--- rcs-5.9.4.orig/tests/t620
+++ rcs-5.9.4/tests/t620
@@ -1,6 +1,6 @@
# t620 --- strange invocation: ci, co, merge, rcs, rcsdiff, rcsmerge, rlog
#
-# Copyright (C) 2011-2015 Thien-Thi Nguyen
+# Copyright (C) 2011-2017 Thien-Thi Nguyen
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
diff --git rcs-5.9.4.orig/tests/t630 rcs-5.9.4/tests/t630
index b34c032..2c8e932 100644
--- rcs-5.9.4.orig/tests/t630
+++ rcs-5.9.4/tests/t630
@@ -1,6 +1,6 @@
# t630 --- co -S -l
#
-# Copyright (C) 2011-2015 Thien-Thi Nguyen
+# Copyright (C) 2011-2017 Thien-Thi Nguyen
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
diff --git rcs-5.9.4.orig/tests/t780 rcs-5.9.4/tests/t780
index 5c11ce2..9f2dbab 100644
--- rcs-5.9.4.orig/tests/t780
+++ rcs-5.9.4/tests/t780
@@ -1,6 +1,6 @@
# t780 --- rcs -o
#
-# Copyright (C) 2013-2015 Thien-Thi Nguyen
+# Copyright (C) 2013-2017 Thien-Thi Nguyen
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
diff --git rcs-5.9.4.orig/tests/t790 rcs-5.9.4/tests/t790
index 82f4313..f11b6a1 100644
--- rcs-5.9.4.orig/tests/t790
+++ rcs-5.9.4/tests/t790
@@ -1,6 +1,6 @@
# t790 --- rcsclean
#
-# Copyright (C) 2013-2015 Thien-Thi Nguyen
+# Copyright (C) 2013-2017 Thien-Thi Nguyen
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
@@ -29,6 +29,14 @@ must 'rcsclean -kk'
must 'rcsclean -kk -kk'
must 'rcsclean -V4'
+# Also check warning.
+cmd='rcsclean -V4 -V3'
+must "$cmd 1>rout 2>rerr"
+noiselessness_rules rout "$cmd"
+silence_means_death rerr "$cmd"
+grep 'redefinition.*-V' rerr 1>/dev/null \
+ || problem "incorrect diagnostic"
+
cd ..
exit 0
diff --git rcs-5.9.4.orig/tests/t800 rcs-5.9.4/tests/t800
index 80b3a96..5a44985 100644
--- rcs-5.9.4.orig/tests/t800
+++ rcs-5.9.4/tests/t800
@@ -1,6 +1,6 @@
# t800 --- outdating everything leaves "empty" RCS file
#
-# Copyright (C) 2010-2015 Thien-Thi Nguyen
+# Copyright (C) 2010-2017 Thien-Thi Nguyen
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
diff --git rcs-5.9.4.orig/tests/t801 rcs-5.9.4/tests/t801
index 4cf1275..febe400 100644
--- rcs-5.9.4.orig/tests/t801
+++ rcs-5.9.4/tests/t801
@@ -1,6 +1,6 @@
# t801 --- ci -dYYYY-DOY (day of year) parsing
#
-# Copyright (C) 2011-2015 Thien-Thi Nguyen
+# Copyright (C) 2011-2017 Thien-Thi Nguyen
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
diff --git rcs-5.9.4.orig/tests/t802 rcs-5.9.4/tests/t802
index 139847c..72bce8f 100644
--- rcs-5.9.4.orig/tests/t802
+++ rcs-5.9.4/tests/t802
@@ -1,6 +1,6 @@
# t802 --- ci -dYYYY-wWW-D (ISO week and day) parsing
#
-# Copyright (C) 2011-2015 Thien-Thi Nguyen
+# Copyright (C) 2011-2017 Thien-Thi Nguyen
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
diff --git rcs-5.9.4.orig/tests/t803 rcs-5.9.4/tests/t803
index 1821157..8b7beb5 100644
--- rcs-5.9.4.orig/tests/t803
+++ rcs-5.9.4/tests/t803
@@ -1,6 +1,6 @@
# t803 --- symbolic to numeric w/ common prefix
#
-# Copyright (C) 2013-2015 Thien-Thi Nguyen
+# Copyright (C) 2013-2017 Thien-Thi Nguyen
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
diff --git rcs-5.9.4.orig/tests/t804 rcs-5.9.4/tests/t804
index 919dc31..ac79df6 100644
--- rcs-5.9.4.orig/tests/t804
+++ rcs-5.9.4/tests/t804
@@ -1,6 +1,6 @@
# t804 --- revert on unchanged on a branch
#
-# Copyright (C) 2014, 2015 Thien-Thi Nguyen
+# Copyright (C) 2014-2017 Thien-Thi Nguyen
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
diff --git rcs-5.9.4.orig/tests/t805 rcs-5.9.4/tests/t805
index 8a1816e..0f54bfa 100644
--- rcs-5.9.4.orig/tests/t805
+++ rcs-5.9.4/tests/t805
@@ -1,6 +1,6 @@
# t805 --- stdio/fd desync regression
#
-# Copyright (C) 2014, 2015 Thien-Thi Nguyen
+# Copyright (C) 2014-2017 Thien-Thi Nguyen
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
diff --git rcs-5.9.4/tests/t806 rcs-5.9.4/tests/t806
new file mode 100644
index 0000000..d84abac
--- /dev/null
+++ rcs-5.9.4/tests/t806
@@ -0,0 +1,50 @@
+# t806 --- invalid RCS file: missing string for desc, log, text
+#
+# Copyright (C) 2016, 2017 Thien-Thi Nguyen
+#
+# This program is free software: you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation, either version 3 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty
+# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+. $srcdir/common
+split_std_out_err
+$hey echo ' -*- org -*-'
+
+##
+# Check that missing string value for desc, log and text
+# cause rlog to abort w/ missing KEYWORD message.
+##
+
+try ()
+{
+ # $1 -- sed(1) address range to delete
+ # $2 -- RCS file keyword
+ addr=$1
+ kw=$2
+ context="for missing $kw string"
+ err=$wd/err.$kw
+
+ $hey echo "* $kw"
+ sed ${addr}d `bundled_commav two` > $v
+ rlog $v 2>$err \
+ && problem "rlog did not fail $context"
+ grep -n -H "missing string after.*$kw" $err >/dev/null \
+ || problem "wrong diagnostic $context"
+}
+
+try 19,20 desc
+try 25,26 log
+try 28,30 text
+
+exit 0
+
+# t806 ends here
diff --git rcs-5.9.4/tests/t807 rcs-5.9.4/tests/t807
new file mode 100644
index 0000000..55ba17c
--- /dev/null
+++ rcs-5.9.4/tests/t807
@@ -0,0 +1,34 @@
+# t807 --- rlog +/- summation w/ NUL in ed script
+#
+# Copyright (C) 2016, 2017 Thien-Thi Nguyen
+#
+# This program is free software: you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation, either version 3 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty
+# of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+. $srcdir/common
+split_std_out_err no
+$hey set -x
+
+must 'cp `bundled_commav nul-in-ed-script` $v'
+
+##
+# Check that rlog counts additions/deletions accurately
+# in the presence of NUL in the ed script (text string).
+##
+
+must 'rlog $v > $wd/rout'
+must "grep -F 'lines: +2 -2' $wd/rout"
+
+exit 0
+
+# t807 ends here
diff --git rcs-5.9.4.orig/tests/t810 rcs-5.9.4/tests/t810
index f72aadd..85bab63 100644
--- rcs-5.9.4.orig/tests/t810
+++ rcs-5.9.4/tests/t810
@@ -1,6 +1,6 @@
# t810 --- ci -l -d -T FILE
#
-# Copyright (C) 2013-2015 Thien-Thi Nguyen
+# Copyright (C) 2013-2017 Thien-Thi Nguyen
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
diff --git rcs-5.9.4.orig/tests/t900 rcs-5.9.4/tests/t900
index fedcd10..4c8fb4e 100644
--- rcs-5.9.4.orig/tests/t900
+++ rcs-5.9.4/tests/t900
@@ -1,6 +1,6 @@
# t900 --- (re)create the RCS files fake/b, fake/b.d/*
#
-# Copyright (C) 2010-2015 Thien-Thi Nguyen
+# Copyright (C) 2010-2017 Thien-Thi Nguyen
#
# This program is free software: you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
@@ -23,10 +23,12 @@ $hey echo ' -*- org -*-'
##
# Run the program $srcdir/fake/b.make to make b and b.d.
# Massage these a bit and compare them with that in $srcdir/fake.
-# NB: We jam env LOGNAME=ttn to make comparison easier.
+# NB: We jam env vars LOGNAME and USER (both) to "ttn"
+# to make comparison easier.
##
-LOGNAME=ttn ; export LOGNAME
+LOGNAME=ttn 2>/dev/null ; export LOGNAME
+USER=ttn ; export USER
prep_b_comparison
TMPDIR="$wdabs"
diff --git rcs-5.9.4.orig/tests/t999 rcs-5.9.4/tests/t999
index 6bdbf54..d3078f8 100644
--- rcs-5.9.4.orig/tests/t999
+++ rcs-5.9.4/tests/t999
@@ -1,6 +1,6 @@
# t999 --- the original src/rcstest
#
-# Copyright (C) 2010-2015 Thien-Thi Nguyen
+# Copyright (C) 2010-2017 Thien-Thi Nguyen
# Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995 Paul Eggert
#
# This program is free software: you can redistribute it and/or
@@ -437,6 +437,9 @@ date: $date; author: w; state: seriously-spurious; lines: +14 -1
EOF
test $? = 0 || failed 'rlog'
+# Exercise RCSINIT processing.
+RCSINIT="-wnobody $RCSINIT"
+
rlog a.c a.c >/dev/null
test $? = 0 || failed 'rlog with working file repeated'
@@ -444,4 +447,6 @@ test ! -f $lockfile || problem 'lock file not removed'
cd ..
+exit 0
+
# t999 ends here