diff options
author | Niall O'Higgins <niallo@cvs.openbsd.org> | 2005-10-17 22:04:55 +0000 |
---|---|---|
committer | Niall O'Higgins <niallo@cvs.openbsd.org> | 2005-10-17 22:04:55 +0000 |
commit | d6f20802c7241c14596cbd238c4aaae6bc58c291 (patch) | |
tree | e89c47834d79cf68a3a827ffa089898c6d0c31c9 /usr.bin/rcs/ci.c | |
parent | 628b0c8626b04e4c1e2e6ff67c0a02b0c7cb856a (diff) |
KNF;
Diffstat (limited to 'usr.bin/rcs/ci.c')
-rw-r--r-- | usr.bin/rcs/ci.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/usr.bin/rcs/ci.c b/usr.bin/rcs/ci.c index 860a457047d..a4193dee4c8 100644 --- a/usr.bin/rcs/ci.c +++ b/usr.bin/rcs/ci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ci.c,v 1.41 2005/10/17 15:33:12 joris Exp $ */ +/* $OpenBSD: ci.c,v 1.42 2005/10/17 22:04:54 niallo Exp $ */ /* * Copyright (c) 2005 Niall O'Higgins <niallo@openbsd.org> * All rights reserved. @@ -126,6 +126,16 @@ checkin_main(int argc, char **argv) interactive = 0; cvs_printf("rcs_msg: %s\n", rcs_msg); break; + case 'N': + if ((symbol = strdup(rcs_optarg)) == NULL) { + cvs_log(LP_ERRNO, "out of memory"); + exit(1); + } + if (rcs_sym_check(symbol) != 1) { + cvs_log(LP_ERR, "invalid symbol `%s'", symbol); + exit(1); + } + break; case 'n': if ((symbol = strdup(rcs_optarg)) == NULL) { cvs_log(LP_ERRNO, "out of memory"); @@ -346,14 +356,17 @@ checkin_main(int argc, char **argv) if ((ret = rcs_sym_add(file, symbol, newrev) == -1) && (rcs_errno == RCS_ERR_DUPENT)) { char tmp[16]; - rcsnum_tostr(rcs_sym_getrev(file, symbol), tmp, sizeof(tmp)); - cvs_log(LP_ERR, "symbolic name %s already bound to %s", + rcsnum_tostr(rcs_sym_getrev(file, symbol), + tmp, sizeof(tmp)); + cvs_log(LP_ERR, + "symbolic name %s already bound to %s", symbol, tmp); status = 1; rcs_close(file); continue; } else if (ret == -1) { - cvs_printf("problem adding symbol: %s\n", symbol); + cvs_printf("problem adding symbol: %s\n", + symbol); status = 1; rcs_close(file); continue; |