summaryrefslogtreecommitdiff
path: root/usr.bin/cvs/rcs.c
AgeCommit message (Collapse)Author
2011-05-02Fix bad return value check for rcsnum_cmp()Charles Longeau
ok nickm@ xsa@
2011-03-27Get rid of some warnings, from Michael W Bombardieri.Nicholas Marriott
2010-11-11Nuke dead assignments and a dead function, from Michael W BombardieriNicholas Marriott
using lint.
2010-10-31init was passing a writable file descriptor into rcs_open which was thenNicholas Marriott
failing to fdopen() it as readable. It doesn't need to pass in the fd at all, so just change it to pass -1 which makes cvs init work again. In fact, the fd should never need to be writable - it is only used for reading. RCS_WRITE triggers a rewrite on the file on rcs_close() but this is done by using a temporary and rename(2) (RCS_WRITE is a poor name for the flag). So while here, add a couple of comments to hopefully make it a little clearer. There is some confusion about how this is used in other places but checking those is a separate issue. with and ok tobias
2010-10-27Merge -k and expand @@ parsing code between OpenCVS and OpenRCS, resultingTobias Stoeckmann
in a performance gain in OpenCVS in some "cvs update" scenarios. ok zinovik
2010-10-20Remove the need for rp_file in parser structure, instead keep only oneTobias Stoeckmann
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
2010-10-15Fixed default branch handling and added support for branches in branches.Tobias Stoeckmann
ok nicm
2010-10-15Replaced RCS parser code with new rcsparse.{c,h}:Tobias Stoeckmann
- be very strict about things we parse - print more information about errors if they occur - do not fatal() directly in parser, give caller a chance to react - fix an rcs design issue when it comes to login names tested by many on tech@ ok xsa
2010-09-29Ensure that we always parse all deltas before expecting "desc" keyword.Tobias Stoeckmann
ok nicm, zinovik
2010-09-11Fixed typo.Tobias Stoeckmann
ok ray, zinovik
2010-09-03Rename RCSNUM's fd to rf_fd, complies to other variable names andTobias Stoeckmann
OpenRCS. ok xsa, zinovik
2010-09-02rcsnum_parse() allocates already an RCSNUM struct, so it's not needed toTobias Stoeckmann
copy it into a newly allocated one (which is even a memory leak). ok zinovik
2010-07-31When looking for revision, break out of the loop at the end rather thanNicholas Marriott
looping forever. This prevents the server going into an infinite loop when the repository is behind the checkout, but the behaviour is not correct (it is an error rather than ignoring the file), so mark with an XXX for now. Some underlying OpenCVS functions are too fatal()-happy and will probably need to be changed in order to fix this properly. Problem reported by sthen. ok xsa ray
2010-07-23Reduce variable/function name and whitespace differences betweenRay Lai
cvs/rcs. OK xsa zinovik
2010-07-23Rename a bunch of variables and functions, removing the cvs_/rcs_Ray Lai
prefixes to reduce differences between cvs and rcs files. "yes!" nicm
2010-07-21Only use username if author is NULL. Fixes "ci -wusername" when runRay Lai
as root. OK nicm
2010-07-13PR 6423 fix for cvs too, requested by xsa@.Nicholas Marriott
2010-07-09Make cvs and rcs consistent in what characters they'll accept inChristian Weisgerber
symbol/tag names: require the first character to be a letter and allow any printable character (except the RCS specials $,.:;@) afterwards. This matches GNU cvs. ok xsa@ zinovik@ stsp@
2010-03-30This diff synchronizes rcs parser code with OpenRCS. It shrinks code by 3zinovik
lines, but does exactly the same thing. It also removes unneeded variable `buf' ok deraadt@, xsa@
2009-06-07More cvs/diff/rcs convergence:Ray Lai
1. Mostly variable/function renaming, SIZE_T_MAX->SIZE_MAX, and spacing. 2. One strchr -> strncspn. 3. diff had a weird thing where it set file[12] = ofile[12] but never updated file or ofile, then if file and ofile were different it freed it. I removed it. OK millert
2009-06-06Sync some rcsdiff changes to cvsdiff. As a side effect,Ray Lai
cvs diff -t now works. There should be no functional change otherwise. OK millert
2009-03-30kill rp_lines, we do not need it when parsing an RCS file.Joris Vink
incendently, commit made using opencvs entirely. with permission from deraadt@
2009-03-25prevent a very difficult to reach, but possible use after free.Joris Vink
ok tobias@
2009-03-22Properly free allocated memory in error case.Tobias Stoeckmann
ok joris
2009-02-21Properly convert dates between timezones before comparison.Tobias Stoeckmann
ok joris
2009-02-18fix off by one character when constructing $Mdocdate$.Joris Vink
problem found by todd@, ok sthen@
2009-02-15add our temporary RCS file to our temp_files worklist in caseJoris Vink
for some reason we get interrupted before calling rename(). we hate leaving behind temporary files.
2009-01-02Add format attributes to functions that use variable arguments andCan Erkin Acar
make the code -Wformat=2 clean. ok joris@ xsa@
2008-11-09Removed unneeded conversion from RCSNUM to string in rcs_rev_setlog.Tobias Stoeckmann
oki joris@
2008-09-17try getlogin() to get the real username when comitting files as root.Reyk Floeter
this gives better information in log messages when the user logged in with a different uid and used sudo or su to become root. matches the behaviour of gcvs except that we don't fallback to LOGNAME or USER since getlogin() should not lie. ok tobias@
2008-09-12Plugged two memory leaks which could be encountered while using -r argumentTobias Stoeckmann
with various CVS commands. "seems to make sense" xsa@
2008-09-12Be very conservative about state changes with "admin -s". With GNU CVSTobias Stoeckmann
and current OpenCVS code it's possible to change a state in a way that cannot be fixed with another admin call. No objections xsa@
2008-06-26plug a memleak in rcs_rev_getlines() - initially noticed & diff byJoris Vink
Igor Zinovik - but fixed in a better way by myself. ok tobias@
2008-06-15if we are using RCS_PARSE_FULLY we can close the RCS file descriptorJoris Vink
as soon as we are done parsing, since we no longer need it for anything.
2008-06-15Support the addition of new files in branches.Tobias Stoeckmann
ok joris
2008-06-14Conforming to RCS specification, it is possible but unlikely to encounterTobias Stoeckmann
an RCS file which has no head revision set. Some commands actually can work with them (log, status) so support these files. Fixes A LOT of possible segmentation faults. ok joris
2008-06-14Added support for sticky date set in CVS/Tag and CVS/Entries per directory.Tobias Stoeckmann
ok joris
2008-06-14don't always re-open the same CVS/Entries file, instead keep theJoris Vink
last opened CVS/Entries around to operate on and close it whenever we switch directory. gives us a small performance boost, obviously. while doing this, switch the way we write revisions to disk by using fwrite(3) so stuff can get written to disk in chunks instead of writing everything line by line, another win. with help from otto@ ok tobias@
2008-06-14Fixed wrong function name in fatal call.Tobias Stoeckmann
2008-06-12we should be able to handle symbol names that are also RCS tokens,Joris Vink
gnu cvs supports this and we should too really. allows opencvs to properly checkout netbsd trees. spotted & tested by rivo nurges ok tobias@
2008-06-12completely kill the need for TMP_DIR when running checkout,Joris Vink
which gives us better performance among other things. this is however disabled in a few cases: 1) whenever you run checkout over an existing tree (which acts as update) 2) whenever you specify -d or a module alias we're planning on enabling this behaviour for case 2 in the future. anoncvs sysadmins now love us even more. ok tobias@
2008-06-10properly inherit file permissions.Joris Vink
reported & tested by phessler@ input otto@ deraadt@ ok tobias@
2008-06-10more characters are allowed in the symbol lists, found by tobias@Joris Vink
2008-06-10We have a cvs_buf_puts implementation now, also use cvs_buf_putc insteadTobias Stoeckmann
of cvs_buf_append where appropiate. ok joris
2008-06-08rcs_translate_tag mustn't fatal() if it cannot resolve a tag. Breaks '-f'Tobias Stoeckmann
in (r)annotate and (r)diff. ok joris
2008-05-22fix updating to tags pointing at branch revisions;Joris Vink
from Neels Janosch Hofmeyr and Stefan Sperling
2008-05-17Full support of branches added. We lacked proper support of multipleTobias Stoeckmann
branch entry points in one revision as well as branches which started from other branches. ok joris
2008-05-11Memory leak in rcs_delta_stats plugged.Tobias Stoeckmann
ok joris
2008-03-13properly initialize variablesJoris Vink
2008-03-09Fix segmentation fault when running checkout -p on a file withoutTobias Stoeckmann
specified head revision. ok joris