OpenBSD CVS

CVS log for src/usr.bin/rcs/rcsutil.c


[BACK] Up to [local] / src / usr.bin / rcs

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.48 / (download) - annotate - [select for diffs], Fri Aug 11 05:02:21 2023 UTC (9 months, 1 week ago) by guenther
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, HEAD
Changes since 1.47: +14 -16 lines
Diff to previous 1.47 (colored)

Switch rcs_{get,set}_mtime() from returning and taking a time_t to
doing so with a struct timespec and then use tv_nsec = UTIME_OMIT
instead of a (time_t)-1 as a "do nothing" value.  They can then
fully preserve the timestamp

ok millert@

Revision 1.47 / (download) - annotate - [select for diffs], Wed Oct 14 20:07:19 2020 UTC (3 years, 7 months ago) by naddy
Branch: MAIN
CVS Tags: OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9
Changes since 1.46: +2 -2 lines
Diff to previous 1.46 (colored)

typo in error message

Revision 1.46 / (download) - annotate - [select for diffs], Tue Aug 29 16:47:33 2017 UTC (6 years, 8 months ago) by otto
Branch: MAIN
CVS Tags: OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6, OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.45: +2 -2 lines
Diff to previous 1.45 (colored)

kill const and string artithmetic related warnings; ok millert@

Revision 1.45 / (download) - annotate - [select for diffs], Mon Jul 4 01:39:12 2016 UTC (7 years, 10 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1, OPENBSD_6_0_BASE, OPENBSD_6_0
Changes since 1.44: +10 -7 lines
Diff to previous 1.44 (colored)

The -I flag is documented but not implemented.  This fixes that and
also honors the -I flag from ci/co when prompting like GNU RCS.
OK jca@

Revision 1.44 / (download) - annotate - [select for diffs], Sat Jun 13 20:15:21 2015 UTC (8 years, 11 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_9_BASE, OPENBSD_5_9, OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.43: +14 -15 lines
Diff to previous 1.43 (colored)

Convert xfree to free. From Fritjof Bornebusch. ok deraadt

Revision 1.43 / (download) - annotate - [select for diffs], Fri Jan 16 06:40:11 2015 UTC (9 years, 4 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.42: +4 -4 lines
Diff to previous 1.42 (colored)

Replace <sys/param.h> with <limits.h> and other less dirty headers where
possible.  Annotate <sys/param.h> lines with their current reasons.  Switch
to PATH_MAX, NGROUPS_MAX, HOST_NAME_MAX+1, LOGIN_NAME_MAX, etc.  Change
MIN() and MAX() to local definitions of MINIMUM() and MAXIMUM() where
sensible to avoid pulling in the pollution.  These are the files confirmed
through binary verification.
ok guenther, millert, doug (helped with the verification protocol)

Revision 1.42 / (download) - annotate - [select for diffs], Mon Dec 1 21:58:46 2014 UTC (9 years, 5 months ago) by deraadt
Branch: MAIN
Changes since 1.41: +2 -2 lines
Diff to previous 1.41 (colored)

An internal function called xrealloc() is actually a fail-hard
reallocarray()... so rename it.

Revision 1.41 / (download) - annotate - [select for diffs], Fri Oct 10 08:15:25 2014 UTC (9 years, 7 months ago) by otto
Branch: MAIN
Changes since 1.40: +1 -3 lines
Diff to previous 1.40 (colored)

Zap some stored values never read; From Fritjof Bornebusch; ok nicm@

Revision 1.40 / (download) - annotate - [select for diffs], Thu May 29 16:39:42 2014 UTC (9 years, 11 months ago) by tedu
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6
Changes since 1.39: +3 -5 lines
Diff to previous 1.39 (colored)

use calloc, from Benjamin Baier

Revision 1.39 / (download) - annotate - [select for diffs], Tue Apr 16 20:24:45 2013 UTC (11 years, 1 month ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_5_BASE, OPENBSD_5_5, OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.38: +2 -2 lines
Diff to previous 1.38 (colored)

remove wrong casts; ok millert

Revision 1.38 / (download) - annotate - [select for diffs], Mon Dec 6 22:52:55 2010 UTC (13 years, 5 months ago) by chl
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9
Changes since 1.37: +2 -1 lines
Diff to previous 1.37 (colored)

add missing header needed by futimes()

ok tobias@ xsa@ nicm@

Revision 1.37 / (download) - annotate - [select for diffs], Wed Oct 20 19:53:53 2010 UTC (13 years, 7 months ago) by tobias
Branch: MAIN
Changes since 1.36: +7 -4 lines
Diff to previous 1.36 (colored)

Remove the need for rp_file in parser structure, instead keep only one
FILE pointer in RCSFILE.  This fixes some ugliness in closing an
fdopen()ed FILE and its underlying file descriptor.

Notified by Joerg Sonnenberger <joerg at britannica dot bec to de>

discussed with and ok nicm

Revision 1.36 / (download) - annotate - [select for diffs], Wed Sep 8 15:15:50 2010 UTC (13 years, 8 months ago) by tobias
Branch: MAIN
Changes since 1.35: +1 -5 lines
Diff to previous 1.35 (colored)

Set rcs_suffixes to default value on initialization.

ok ray zinovik

Revision 1.35 / (download) - annotate - [select for diffs], Wed Jul 28 09:07:11 2010 UTC (13 years, 9 months ago) by ray
Branch: MAIN
CVS Tags: OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.34: +4 -4 lines
Diff to previous 1.34 (colored)

Make BUFs autoextend by default.  This was already done in OpenCVS
a while ago.

OK zinovik nicm

Revision 1.34 / (download) - annotate - [select for diffs], Fri Jul 23 21:46:05 2010 UTC (13 years, 9 months ago) by ray
Branch: MAIN
Changes since 1.33: +10 -10 lines
Diff to previous 1.33 (colored)

Reduce variable/function name and whitespace differences between
cvs/rcs.

OK xsa zinovik

Revision 1.33 / (download) - annotate - [select for diffs], Sat May 10 20:23:24 2008 UTC (16 years ago) by joris
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7, OPENBSD_4_6_BASE, OPENBSD_4_6, OPENBSD_4_5_BASE, OPENBSD_4_5, OPENBSD_4_4_BASE, OPENBSD_4_4
Changes since 1.32: +3 -1 lines
Diff to previous 1.32 (colored)

properly free suffixes.
OK tobias@

Revision 1.32 / (download) - annotate - [select for diffs], Fri Jan 4 13:45:24 2008 UTC (16 years, 4 months ago) by chl
Branch: MAIN
CVS Tags: OPENBSD_4_3_BASE, OPENBSD_4_3
Changes since 1.31: +1 -11 lines
Diff to previous 1.31 (colored)

remove unused function

from tobias@

ok xsa@ tobias@

Revision 1.31 / (download) - annotate - [select for diffs], Thu Jul 19 06:37:58 2007 UTC (16 years, 10 months ago) by ray
Branch: MAIN
CVS Tags: OPENBSD_4_2_BASE, OPENBSD_4_2
Changes since 1.30: +2 -2 lines
Diff to previous 1.30 (colored)

Sync with cvs:
> xcalloc is unneeded here since i is always 0 and we always use the
> memory after initializing it.
>
> Initial diff from Igor Zinovik.
>
> OK niallo and xsa.

Revision 1.30 / (download) - annotate - [select for diffs], Tue May 29 00:19:10 2007 UTC (16 years, 11 months ago) by ray
Branch: MAIN
Changes since 1.29: +2 -4 lines
Diff to previous 1.29 (colored)

Since xrealloc dies on failure it is safe to directly assign to the
original pointer.  Theo agrees, and so does the rest of the tree
(ssh, etc. all do this already).

Saves a bunch of variables and assignments.

OK niallo@

Revision 1.29 / (download) - annotate - [select for diffs], Tue Feb 27 07:59:13 2007 UTC (17 years, 2 months ago) by xsa
Branch: MAIN
CVS Tags: OPENBSD_4_1_BASE, OPENBSD_4_1
Changes since 1.28: +9 -2 lines
Diff to previous 1.28 (colored)

As done in OpenCVS, general includes cleanup sweep. OK otto@.

Revision 1.28 / (download) - annotate - [select for diffs], Thu Feb 22 19:11:13 2007 UTC (17 years, 2 months ago) by otto
Branch: MAIN
Changes since 1.27: +21 -1 lines
Diff to previous 1.27 (colored)

If a ,suffix file is given as an arg to ci and co, strip it. Avoids
potential disasters.  Initial diff from niallo@, ok niallo@ joris@

Revision 1.27 / (download) - annotate - [select for diffs], Thu Feb 22 08:30:45 2007 UTC (17 years, 2 months ago) by xsa
Branch: MAIN
Changes since 1.26: +3 -3 lines
Diff to previous 1.26 (colored)

Fix const inconsistencies, void pointer artithmetic;
Based on diff from otto@ in OpenCVS. OK otto@.

Revision 1.26 / (download) - annotate - [select for diffs], Thu Jan 11 18:13:33 2007 UTC (17 years, 4 months ago) by niallo
Branch: MAIN
Changes since 1.25: +2 -4 lines
Diff to previous 1.25 (colored)

remove some un-needed buffer NUL-termination.  in openrcs, diff3 is already NUL-terminating its
buffers so we don't need to do it twice.  this allows us to sync rcs_splitlines() with opencvs'
cvs_splitlines().

ok joris@

Revision 1.25 / (download) - annotate - [select for diffs], Wed Jan 10 02:13:23 2007 UTC (17 years, 4 months ago) by ray
Branch: MAIN
Changes since 1.24: +3 -1 lines
Diff to previous 1.24 (colored)

Clear EOF before prompting user for input.

Fixes PR 5342.

OK joris@ and xsa@.

Revision 1.24 / (download) - annotate - [select for diffs], Tue Jan 2 16:43:45 2007 UTC (17 years, 4 months ago) by niallo
Branch: MAIN
Changes since 1.23: +20 -30 lines
Diff to previous 1.23 (colored)

- fix support for checking out binary files.

testing from xsa@ and Igor Sobrado <igor at string1.ciencias.uniovi.es>
ok xsa@

Revision 1.23 / (download) - annotate - [select for diffs], Thu Nov 9 21:47:52 2006 UTC (17 years, 6 months ago) by millert
Branch: MAIN
Changes since 1.22: +13 -10 lines
Diff to previous 1.22 (colored)

Simplify stripping of write bits from file mode.
Add support for reusing the checkin message for multiple files, ala GNU
Fix the message when you abort a checkout and the file was not writable.
OK joris@ niallo@

Revision 1.22 / (download) - annotate - [select for diffs], Thu Oct 12 17:20:12 2006 UTC (17 years, 7 months ago) by niallo
Branch: MAIN
Changes since 1.21: +4 -3 lines
Diff to previous 1.21 (colored)

- convert some warnx() to warn(), which fixes a few stupidly un-informative error messages (found by tom@)
- make rcs_choosefile() save wrt errno, input from ray@

ok joris@ xsa@

Revision 1.21 / (download) - annotate - [select for diffs], Mon Sep 25 23:58:05 2006 UTC (17 years, 7 months ago) by ray
Branch: MAIN
Changes since 1.20: +1 -2 lines
Diff to previous 1.20 (colored)

Remove debugging printf accidentally committed.

OK joris@.

Revision 1.20 / (download) - annotate - [select for diffs], Fri Sep 22 05:38:29 2006 UTC (17 years, 8 months ago) by niallo
Branch: MAIN
Changes since 1.19: +3 -2 lines
Diff to previous 1.19 (colored)

- handle deltatexts which don't end in a newline character. fixes PR #5241.

ok ray@

Revision 1.19 / (download) - annotate - [select for diffs], Tue Sep 19 05:52:23 2006 UTC (17 years, 8 months ago) by otto
Branch: MAIN
Changes since 1.18: +2 -2 lines
Diff to previous 1.18 (colored)

Use S_IS* macros insted of masking with S_IF* flags. The latter may
have multiple bits set, which lead to surprising results. Spotted by
Paul Stoeber, more to come. ok millert@ pedro@ jaredy@ djm@

Revision 1.18 / (download) - annotate - [select for diffs], Wed Aug 16 07:39:15 2006 UTC (17 years, 9 months ago) by ray
Branch: MAIN
CVS Tags: OPENBSD_4_0_BASE, OPENBSD_4_0
Changes since 1.17: +6 -3 lines
Diff to previous 1.17 (colored)

Improve rcs_buf_load() by setting errno appropriately on failure and
never print errors or quit on error.

Fix usages of rcs_buf_load() and rcs_set_description.

Also plug an fd leak.

OK xsa@

Revision 1.17 / (download) - annotate - [select for diffs], Sat Jul 8 09:14:03 2006 UTC (17 years, 10 months ago) by ray
Branch: MAIN
Changes since 1.16: +3 -6 lines
Diff to previous 1.16 (colored)

rcs_splitlines() can never return NULL, so don't check for it.

OK joris@

Revision 1.16 / (download) - annotate - [select for diffs], Tue Jul 4 22:14:56 2006 UTC (17 years, 10 months ago) by niallo
Branch: MAIN
Changes since 1.15: +3 -1 lines
Diff to previous 1.15 (colored)

- plug a memory leak

Revision 1.15 / (download) - annotate - [select for diffs], Sat Jun 3 03:05:10 2006 UTC (17 years, 11 months ago) by niallo
Branch: MAIN
Changes since 1.14: +21 -15 lines
Diff to previous 1.14 (colored)

- correctly handle binary files; say bye bye to using c strings for deltatexts.

"slap it in" joris@

Revision 1.14 / (download) - annotate - [select for diffs], Sun May 28 23:16:31 2006 UTC (17 years, 11 months ago) by ray
Branch: MAIN
Changes since 1.13: +3 -3 lines
Diff to previous 1.13 (colored)

Remove a lot of xstrdup() calls in getopt() loops, which are usually
unnecessary.  These xstrdup() calls don't call xfree() before anyway,
so if a flag is given multiple times memory leaks would have resulted.

OK joris@

Revision 1.13 / (download) - annotate - [select for diffs], Sat May 27 08:12:29 2006 UTC (17 years, 11 months ago) by ray
Branch: MAIN
Changes since 1.12: +3 -3 lines
Diff to previous 1.12 (colored)

Rename RCSFILE.fd to RCSFILE.rf_fd, plus minor spacing nits.  No
binary change.

OK xsa@

Revision 1.12 / (download) - annotate - [select for diffs], Sat May 27 05:49:14 2006 UTC (17 years, 11 months ago) by ray
Branch: MAIN
Changes since 1.11: +1 -22 lines
Diff to previous 1.11 (colored)

Remove rcs_statfile().  It was just a wrapper for rcs_choosefile(),
handling exceptions oddly.

OK joris@

Revision 1.11 / (download) - annotate - [select for diffs], Sat May 27 02:58:02 2006 UTC (17 years, 11 months ago) by ray
Branch: MAIN
Changes since 1.10: +3 -4 lines
Diff to previous 1.10 (colored)

rcs_choosefile() no longer returns char *, it returns a file
descriptor; fix comment.

Improve spacing.

OK joris@

Revision 1.10 / (download) - annotate - [select for diffs], Tue May 9 12:31:27 2006 UTC (18 years ago) by ray
Branch: MAIN
Changes since 1.9: +3 -6 lines
Diff to previous 1.9 (colored)

Remove unused variable leftover from race condition cleanup.

OK xsa@.

Revision 1.9 / (download) - annotate - [select for diffs], Mon May 8 21:55:39 2006 UTC (18 years ago) by ray
Branch: MAIN
Changes since 1.8: +2 -2 lines
Diff to previous 1.8 (colored)

Use warnx() when errno is not set.

OK joris@.

Revision 1.8 / (download) - annotate - [select for diffs], Sat Apr 29 05:31:28 2006 UTC (18 years ago) by ray
Branch: MAIN
Changes since 1.7: +5 -3 lines
Diff to previous 1.7 (colored)

Check return values for all strlcpy, and strlcat calls.

OK xsa@ and probably others.

Revision 1.7 / (download) - annotate - [select for diffs], Thu Apr 27 07:59:33 2006 UTC (18 years ago) by xsa
Branch: MAIN
Changes since 1.6: +155 -1 lines
Diff to previous 1.6 (colored)

zap util.[ch] and move the content into rcsutil.[ch].
discussed with joris@.

Revision 1.6 / (download) - annotate - [select for diffs], Wed Apr 26 21:55:22 2006 UTC (18 years ago) by joris
Branch: MAIN
Changes since 1.5: +57 -46 lines
Diff to previous 1.5 (colored)

prevent file races by obtaining an fd for the RCS file and
do our operations on that, this is safe and guarantees we
can operate on the file until we close(2) it.

a fix is coming for the remaining races in our diff code.
okay niallo@ and ray@

Revision 1.5 / (download) - annotate - [select for diffs], Wed Apr 26 02:55:13 2006 UTC (18 years ago) by joris
Branch: MAIN
Changes since 1.4: +13 -13 lines
Diff to previous 1.4 (colored)

fork our code we shared between openrcs/cvs into the openrcs dir.

this was starting to become inhuman to maintain without
ugly ugly hacks in the shared code, and it will be easier
to make specific changes for openrcs without touching the
soon-to-be-replaced opencvs code.

Revision 1.4 / (download) - annotate - [select for diffs], Tue Apr 25 13:55:49 2006 UTC (18 years ago) by xsa
Branch: MAIN
Changes since 1.3: +2 -2 lines
Diff to previous 1.3 (colored)

quote strings consistently.

Revision 1.3 / (download) - annotate - [select for diffs], Tue Apr 25 13:36:36 2006 UTC (18 years ago) by xsa
Branch: MAIN
Changes since 1.2: +11 -11 lines
Diff to previous 1.2 (colored)

fatal() -> err()/errx() as we try to not depend on heavy cvs_log().
OK joriski.

Revision 1.2 / (download) - annotate - [select for diffs], Mon Apr 24 04:51:57 2006 UTC (18 years ago) by ray
Branch: MAIN
Changes since 1.1: +33 -1 lines
Diff to previous 1.1 (colored)

o Better match GNU behavior (a bare -t does NOT read from stdin,
  unlike rcs).
o Share code with rcs by moving rcs_set_description() to rcsutil.c.
o Change description prompt from #define to const char *.

OK xsa@

Revision 1.1 / (download) - annotate - [select for diffs], Fri Apr 21 17:17:29 2006 UTC (18 years, 1 month ago) by xsa
Branch: MAIN

move shared functions into rcsutil.[ch]; this makes rcsprog.c cleaner;
"the voices in my head say OK!" joris@.

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.