diff options
author | Xavier Santolaria <xsa@cvs.openbsd.org> | 2005-06-02 16:05:39 +0000 |
---|---|---|
committer | Xavier Santolaria <xsa@cvs.openbsd.org> | 2005-06-02 16:05:39 +0000 |
commit | 0ca9c2501c0cb1f235000d3aff2682e7dc051b18 (patch) | |
tree | 442e5c578e416dbd0ea53fefad1c260fb8afde88 | |
parent | 1d1d01937fadf9b0fc920c85b78e6e22a30ca399 (diff) |
- set LP_ABORT log level when action is abored by user instead of LP_ERR
- missing \n in output of an unchanged log message warning
- always use the command name in error messages instead of aliases
ok jfb@.
-rw-r--r-- | usr.bin/cvs/log.c | 11 | ||||
-rw-r--r-- | usr.bin/cvs/logmsg.c | 6 |
2 files changed, 11 insertions, 6 deletions
diff --git a/usr.bin/cvs/log.c b/usr.bin/cvs/log.c index 57697f21ffb..82e01b2a84c 100644 --- a/usr.bin/cvs/log.c +++ b/usr.bin/cvs/log.c @@ -1,4 +1,4 @@ -/* $OpenBSD: log.c,v 1.16 2005/05/31 08:58:48 xsa Exp $ */ +/* $OpenBSD: log.c,v 1.17 2005/06/02 16:05:38 xsa Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -218,6 +218,11 @@ cvs_vlog(u_int level, const char *fmt, va_list vap) ecp = 0; #ifdef CVS + struct cvs_cmd *cmdp; + + /* always use the command name in error messages, not aliases */ + cmdp = cvs_findcmd(cvs_command); + /* The cvs program appends the command name to the program name */ if (level == LP_TRACE) { strlcpy(prefix, " -> ", sizeof(prefix)); @@ -226,10 +231,10 @@ cvs_vlog(u_int level, const char *fmt, va_list vap) } else if (cvs_command != NULL) { if (level == LP_ABORT) snprintf(prefix, sizeof(prefix), "%s [%s aborted]", - __progname, cvs_command); + __progname, cmdp->cmd_name); else snprintf(prefix, sizeof(prefix), "%s %s", __progname, - cvs_command); + cmdp->cmd_name); } else /* just use the standard strlcpy */ #endif strlcpy(prefix, __progname, sizeof(prefix)); diff --git a/usr.bin/cvs/logmsg.c b/usr.bin/cvs/logmsg.c index 7a89b6082bd..e1ac250fbdf 100644 --- a/usr.bin/cvs/logmsg.c +++ b/usr.bin/cvs/logmsg.c @@ -1,4 +1,4 @@ -/* $OpenBSD: logmsg.c,v 1.14 2005/05/31 08:58:48 xsa Exp $ */ +/* $OpenBSD: logmsg.c,v 1.15 2005/06/02 16:05:38 xsa Exp $ */ /* * Copyright (c) 2004 Jean-Francois Brousseau <jfb@openbsd.org> * All rights reserved. @@ -266,7 +266,7 @@ cvs_logmsg_get(const char *dir, struct cvs_flist *added, /* nothing was entered */ fprintf(stderr, - "Log message unchanged or not specified\na)bort, " + "\nLog message unchanged or not specified\na)bort, " "c)ontinue, e)dit, !)reuse this message unchanged " "for remaining dirs\nAction: (continue) "); @@ -280,7 +280,7 @@ cvs_logmsg_get(const char *dir, struct cvs_flist *added, fprintf(stderr, "invalid input\n"); continue; } else if (buf[0] == 'a') { - cvs_log(LP_ERR, "aborted by user"); + cvs_log(LP_ABORT, "aborted by user"); break; } else if ((buf[0] == '\n') || (buf[0] == 'c')) { /* empty message */ |