summaryrefslogtreecommitdiff
path: root/usr.bin/rcs/rcsprog.c
AgeCommit message (Collapse)Author
2006-10-12- convert some warnx() to warn(), which fixes a few stupidly un-informative ↵Niall O'Higgins
error messages (found by tom@) - make rcs_choosefile() save wrt errno, input from ray@ ok joris@ xsa@
2006-08-16Improve rcs_buf_load() by setting errno appropriately on failure andRay Lai
never print errors or quit on error. Fix usages of rcs_buf_load() and rcs_set_description. Also plug an fd leak. OK xsa@
2006-05-29Plug more memory leaks.Ray Lai
OK joris@
2006-05-28Remove a lot of xstrdup() calls in getopt() loops, which are usuallyRay Lai
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@
2006-05-28Move -A<oldfile> handling into separate chunk of code. This alsoRay Lai
removes a memory leak if -A is given multiple times. OK joris@
2006-05-27Remove rcs_statfile(). It was just a wrapper for rcs_choosefile(),Ray Lai
handling exceptions oddly. OK joris@
2006-05-19fix printf + add missing printf when unlocking file (-u).Xavier Santolaria
2006-05-15missing bits for a working merge(1). Built and enabled.Xavier Santolaria
OK joris@ ray@.
2006-05-11fix informative msg's wrt to -q and stderr. now matches gnu/usr.bin/rcs.Xavier Santolaria
2006-05-09Remove /* NOTREACHED */ comments, now that lint is smart aboutRay Lai
__dead. I never should have put them there. OK xsa@.
2006-05-01using *_FOREACH macros is really bad when we are actuallyJoris Vink
removing elements from the list inside the loop. this has been documented *clearly* in queue(3). okay niallo@
2006-04-29Check return values for all strlcpy, and strlcat calls.Ray Lai
OK xsa@ and probably others.
2006-04-29Clarify man pages to match -t behavior and pretty up usage strings.Ray Lai
OK xsa@ and jmc@.
2006-04-28remove -h; ok xsaJason McIntyre
2006-04-27move -M into compat land; ok xsaJason McIntyre
2006-04-26prevent file races by obtaining an fd for the RCS file andJoris Vink
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@
2006-04-26fork our code we shared between openrcs/cvs into the openrcs dir.Joris Vink
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.
2006-04-25quote strings consistently.Xavier Santolaria
2006-04-25fatal() -> err()/errx() as we try to not depend on heavy cvs_log().Xavier Santolaria
OK joriski.
2006-04-24be consistent in error messages for wrongly specified keyword substitutionXavier Santolaria
mode for `-k'.
2006-04-24o Better match GNU behavior (a bare -t does NOT read from stdin,Ray Lai
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@
2006-04-21move shared functions into rcsutil.[ch]; this makes rcsprog.c cleaner;Xavier Santolaria
"the voices in my head say OK!" joris@.
2006-04-21match former rcs implementation warning message if no options areXavier Santolaria
specified when using rcs(1). OK ray@ joris@.
2006-04-21remove overkill cvs_log() and rather use warn()/warnx().Xavier Santolaria
OK ray@ and discussed with joris@.
2006-04-21switch -p handling to bitwise flags; OK ray@.Xavier Santolaria
2006-04-19switch -q handling to bitwise flags; OK ray@ niallo@.Xavier Santolaria
2006-04-18Combine code to prompt user for input into a shared function,Ray Lai
reducing some complex fats from ci.c. OK joris@
2006-04-18Remove -h flag from rcs_getopt loop, which is not in GNU.Ray Lai
OK xsa@
2006-04-17plug memory leak; OK ray@.Xavier Santolaria
2006-04-15dont stupidly duplicate code. make rlog use rcs_rev_select() and thusXavier Santolaria
nuke rlog_rev_select(). OK niallo@.
2006-04-14- don't append the extension if it's already there (PR 5076).Joris Vink
- show magic branches in rlog (thanks for that nicer hack niall). - correct output in rcsdiff, so we perfectly match gnu's all these bugs were found by sturm@ while he was using cvsweb (which uses the RCS tools). "it is in my view that you should put it in" niallo@
2006-04-14excessive addition to brackets is a mental disease. you will goTheo de Raadt
blind, too. seek help. no binary change, ok joris
2006-04-13add support for the openrcs -o'range' option.Joris Vink
-o allows users to delete revisions in the specified RCS files. example: rcs -o1.4:1.6 foo deletes revisions 1.4 - 1.6 rcs -o1.3 foo deletes revision 1.3 joint work with niallo@ okay niallo@
2006-04-13clean up temporary files when we finish running.Joris Vink
"cool" niallo@
2006-04-13*** empty log message ***Ray Lai
2006-04-12Better match GNU behavior for rcs -l and rcs -u.Ray Lai
Save 2 bytes of newlines. OK joris@
2006-04-12Clean up <rev> handling. Whenever a revision is specified after aRay Lai
flag, it calls one of two new functions: rcs_setrevstr() or rcs_setrevstr2(). rcs_setrevstr() sets a string to another string, and complains if it was set more than once. rcs_setrevstr2() takes two strings, sets one after the other, and fatal()s if more than two strings were given. All <rev> handling is now done in the loop that goes through each argv. This is necessary for parsing symbols, which will be much easier after this. Along the way a lot of memory leaks were cleaned up. There is one area where rcs_set_rev() is called, which allocates a RCSNUM and stores it in pb.newrev, but it segfaults whenever I try to rcsnum_free() it. I put an /* XXX */ comment there for now. Passes regression tests and the code is less complicated in some ways (to me). Suggestions and OK xsa@
2006-04-11Don't rcs_close() before fatal(). After much hesitation, joris@Ray Lai
and xsa@ finally convinced me this is safe (and better). OK joris@, niallo@, and xsa@.
2006-04-10change rcs_kwexp_set() return type to void and simplify its use. OK niallo@.Xavier Santolaria
2006-04-07change rcs_set_mtime() return type to void.Xavier Santolaria
2006-04-06-z can take no argument.Xavier Santolaria
2006-04-01Add rcs -l, rcs -u, and regression tests.Ray Lai
``put it all in'' joris@
2006-04-01Keep cvs flags in `flags', rcs flags in `rcsflags' in rcsprog.h.Ray Lai
Prevents bitfield pollution between the two. ``This is how it should be.'' niallo@
2006-03-28shudup rcs_set_description(), so regress tests are happy too.Xavier Santolaria
2006-03-27- properly implement GNU file modes. basically, checkout will inheritNiall O'Higgins
permissions from rcs file and initial checkin will inherit permissions from working file. problem spotted by uwe@ ok ray@ xsa@
2006-03-27Fix and clean up -t flag:Ray Lai
- Add comments. - Support -t-inline-comments-like-man-page-says. - -tfilename still works. - When using -t (read description from stdin) don't end when first character is `.'. Instead, end if whole line consists of one `.'. - Add regression test. I also changed the regression Makefile to have a trailing slash on the final element. As long as we have a blank line it will be fine, plus it will save us some trouble when adding new tests. After adding line breaks, ``rest looks fine.'' xsa@
2006-03-27Changes:Ray Lai
- RCS_CREATE is now set in flags. - Since flags & RCS_CREATE is used in rcs_statfile(), flags is now a global variable. - RCS_[ENT]FLAG -> RCSPROG_[ENT]FLAG - Call rcs_set_description() if -t flag is given or if RCS_CREATE is set, checked in that order. If the -t flag is given and RCS_CREATE is set, don't call rcs_set_description() twice. ``commitski!!'' xsa@
2006-03-27Plug a memory leak for all cvs_strsplit call sites; ok xsa@Patrick Latifi
2006-03-24Allow the -x flag to be used without an extension.Ray Lai
``that makes sense'' xsa@
2006-03-23use fatal() in rcs_lock_setmode(); OK ray@.Xavier Santolaria