OpenBSD CVS

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


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

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.29 / (download) - annotate - [select for diffs], Sun Oct 24 21:24:17 2021 UTC (2 years, 6 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, HEAD
Changes since 1.28: +2 -2 lines
Diff to previous 1.28 (colored)

For open/openat, if the flags parameter does not contain O_CREAT, the
3rd (variadic) mode_t parameter is irrelevant.  Many developers in the past
have passed mode_t (0, 044, 0644, or such), which might lead future people
to copy this broken idiom, and perhaps even believe this parameter has some
meaning or implication or application. Delete them all.
This comes out of a conversation where tb@ noticed that a strange (but
intentional) pledge behaviour is to always knock-out high-bits from
mode_t on a number of system calls as a safety factor, and his bewilderment
that this appeared to be happening against valid modes (at least visually),
but no sorry, they are all irrelevant junk.  They could all be 0xdeafbeef.
ok millert

Revision 1.28 / (download) - annotate - [select for diffs], Fri Jun 28 13:35:03 2019 UTC (4 years, 10 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6
Changes since 1.27: +2 -2 lines
Diff to previous 1.27 (colored)

When system calls indicate an error they return -1, not some arbitrary
value < 0.  errno is only updated in this case.  Change all (most?)
callers of syscalls to follow this better, and let's see if this strictness
helps us in the future.

Revision 1.27 / (download) - annotate - [select for diffs], Sun Oct 16 13:35:51 2016 UTC (7 years, 7 months ago) by okan
Branch: MAIN
CVS Tags: 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, OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.26: +2 -2 lines
Diff to previous 1.26 (colored)

Quiet compiler warnings; as applied to usr.bin/cvs by millert@

ok millert@

Revision 1.26 / (download) - annotate - [select for diffs], Mon Nov 2 16:45:21 2015 UTC (8 years, 6 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0, OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.25: +3 -1 lines
Diff to previous 1.25 (colored)

Allow rcsnum_free and buf_free to accept NULL and remove various NULL
checks that are now unnecessary, from Michael W Bombardieri. ok millert

Revision 1.25 / (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_8_BASE, OPENBSD_5_8
Changes since 1.24: +6 -6 lines
Diff to previous 1.24 (colored)

Convert xfree to free. From Fritjof Bornebusch. ok deraadt

Revision 1.24 / (download) - annotate - [select for diffs], Thu Feb 5 12:59:58 2015 UTC (9 years, 3 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7
Changes since 1.23: +2 -1 lines
Diff to previous 1.23 (colored)

Include stdint.h, not limits.h to get SIZE_MAX.  OK guenther@

Revision 1.23 / (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.22: +2 -2 lines
Diff to previous 1.22 (colored)

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

Revision 1.22 / (download) - annotate - [select for diffs], Wed Jul 6 15:36:52 2011 UTC (12 years, 10 months ago) by nicm
Branch: MAIN
CVS Tags: OPENBSD_5_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5, OPENBSD_5_4_BASE, OPENBSD_5_4, 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
Changes since 1.21: +10 -1 lines
Diff to previous 1.21 (colored)

Replace the keyword expansion code with a faster, more readable version
which additionally also supports $Log$ and $Locker. Written by Joerg
Sonnenberger and tweaked by me.

ok ray

Revision 1.21 / (download) - annotate - [select for diffs], Wed Apr 20 19:34:16 2011 UTC (13 years, 1 month ago) by nicm
Branch: MAIN
Changes since 1.20: +1 -3 lines
Diff to previous 1.20 (colored)

Remove some unneeded includes and dead code, from Michael W Bombardieri.

ok jasper xsa

Revision 1.20 / (download) - annotate - [select for diffs], Sun Mar 27 18:20:14 2011 UTC (13 years, 1 month ago) by jasper
Branch: MAIN
Changes since 1.19: +1 -21 lines
Diff to previous 1.19 (colored)

- garbage collect unused buf_fappend(), which was also removed from ocvs's
buf.c some time ago.

from Michael W. Bombardieri
ok chl@ nicm@

Revision 1.19 / (download) - annotate - [select for diffs], Wed Dec 1 20:25:15 2010 UTC (13 years, 5 months ago) by chl
Branch: MAIN
CVS Tags: OPENBSD_4_9_BASE, OPENBSD_4_9
Changes since 1.18: +2 -1 lines
Diff to previous 1.18 (colored)

add missing header needed by mkstemp()

ok stsp@

Revision 1.18 / (download) - annotate - [select for diffs], Wed Sep 8 20:49:11 2010 UTC (13 years, 8 months ago) by nicm
Branch: MAIN
Changes since 1.17: +8 -40 lines
Diff to previous 1.17 (colored)

Improve buf.c comments, from zinovik.

ok stsp

Revision 1.17 / (download) - annotate - [select for diffs], Wed Sep 8 15:13:39 2010 UTC (13 years, 8 months ago) by tobias
Branch: MAIN
Changes since 1.16: +7 -16 lines
Diff to previous 1.16 (colored)

Use SIZE_LEFT macro to determine left size instead of calculating with
pointers.

ok zinovik

Revision 1.16 / (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.15: +8 -18 lines
Diff to previous 1.15 (colored)

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

OK zinovik nicm

Revision 1.15 / (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.14: +44 -49 lines
Diff to previous 1.14 (colored)

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

OK xsa zinovik

Revision 1.14 / (download) - annotate - [select for diffs], Fri Jul 23 08:31:19 2010 UTC (13 years, 9 months ago) by ray
Branch: MAIN
Changes since 1.13: +2 -2 lines
Diff to previous 1.13 (colored)

Rename a bunch of variables and functions, removing the cvs_/rcs_
prefixes to reduce differences between cvs and rcs files.

"yes!" nicm

Revision 1.13 / (download) - annotate - [select for diffs], Tue May 29 00:19:10 2007 UTC (16 years, 11 months ago) by ray
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, OPENBSD_4_3_BASE, OPENBSD_4_3, OPENBSD_4_2_BASE, OPENBSD_4_2
Changes since 1.12: +2 -5 lines
Diff to previous 1.12 (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.12 / (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.11: +11 -2 lines
Diff to previous 1.11 (colored)

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

Revision 1.11 / (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.10: +2 -2 lines
Diff to previous 1.10 (colored)

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

Revision 1.10 / (download) - annotate - [select for diffs], Fri Feb 2 04:34:49 2007 UTC (17 years, 3 months ago) by ray
Branch: MAIN
Changes since 1.9: +10 -21 lines
Diff to previous 1.9 (colored)

Remove cb_cur or replace with cb_buf; cb_cur was the same as cb_buf
most of the time and was never of much use.

OK niallo@.

Revision 1.9 / (download) - annotate - [select for diffs], Fri Feb 2 04:24:09 2007 UTC (17 years, 3 months ago) by ray
Branch: MAIN
Changes since 1.8: +1 -35 lines
Diff to previous 1.8 (colored)

Remove unused and buggy {cvs,rcs}_buf_set functions.

Bugginess pointed out and fix provided by Pierre Riteau.

OK joris@.

Revision 1.8 / (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.7: +28 -10 lines
Diff to previous 1.7 (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.7 / (download) - annotate - [select for diffs], Wed Aug 2 03:28:50 2006 UTC (17 years, 9 months ago) by ray
Branch: MAIN
Changes since 1.6: +9 -8 lines
Diff to previous 1.6 (colored)

rcs_buf_set(), rcs_buf_append, and rcs_buf_fappend should not return
ssize_t.  The return values aren't usually checked anyway.

Also remove unnecessary casts and improve type usage.

OK xsa@

Revision 1.6 / (download) - annotate - [select for diffs], Sat Jul 8 09:25:44 2006 UTC (17 years, 10 months ago) by ray
Branch: MAIN
Changes since 1.5: +2 -6 lines
Diff to previous 1.5 (colored)

Remove file mode argument from {cvs|rcs}_buf_write_stmp().  We
always set the temporary file to mode 600, which is already done
by mkstemp().

OK joris@ and xsa@ over a month ago.

Revision 1.5 / (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.4: +10 -1 lines
Diff to previous 1.4 (colored)

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

"slap it in" joris@

Revision 1.4 / (download) - annotate - [select for diffs], Thu Jun 1 21:28:24 2006 UTC (17 years, 11 months ago) by niallo
Branch: MAIN
Changes since 1.3: +2 -2 lines
Diff to previous 1.3 (colored)

-  rcs_buf_release() has no need for u_char since it returns void *

Revision 1.3 / (download) - annotate - [select for diffs], Wed Apr 26 15:08:25 2006 UTC (18 years ago) by xsa
Branch: MAIN
Changes since 1.2: +5 -5 lines
Diff to previous 1.2 (colored)

err() cleanup;

Revision 1.2 / (download) - annotate - [select for diffs], Wed Apr 26 08:07:12 2006 UTC (18 years ago) by xsa
Branch: MAIN
Changes since 1.1: +1 -3 lines
Diff to previous 1.1 (colored)

zap -DRCSPROG leftover.

Revision 1.1 / (download) - annotate - [select for diffs], Wed Apr 26 02:55:13 2006 UTC (18 years ago) by joris
Branch: MAIN

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.

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.