diff options
author | Xavier Santolaria <xsa@cvs.openbsd.org> | 2006-06-04 14:56:10 +0000 |
---|---|---|
committer | Xavier Santolaria <xsa@cvs.openbsd.org> | 2006-06-04 14:56:10 +0000 |
commit | f98c7272f4e84133a3cf95aff759804bb7b32cda (patch) | |
tree | bbb55fcf51fa2a360321df3a01f1965313f9ed2e | |
parent | 9e2788b1c0fddf59a3c08657f6c306e32895d065 (diff) |
fix output if file is lost, unknown, or in the Attic; OK joris@.
-rw-r--r-- | usr.bin/cvs/status.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/usr.bin/cvs/status.c b/usr.bin/cvs/status.c index 74031556617..6be3278e64d 100644 --- a/usr.bin/cvs/status.c +++ b/usr.bin/cvs/status.c @@ -1,4 +1,4 @@ -/* $OpenBSD: status.c,v 1.62 2006/06/01 20:00:52 joris Exp $ */ +/* $OpenBSD: status.c,v 1.63 2006/06/04 14:56:09 xsa Exp $ */ /* * Copyright (c) 2006 Joris Vink <joris@openbsd.org> * @@ -117,7 +117,17 @@ cvs_status_local(struct cvs_file *cf) cf->file_ent->ce_conflict != NULL) status = "File had conflicts on merge"; - cvs_printf("File: %-17s\tStatus: %s\n\n", cf->file_name, status); + if (cf->file_status == FILE_LOST || + cf->file_status == FILE_UNKNOWN || + cf->file_rcs->rf_inattic == 1) { + l = snprintf(buf, sizeof(buf), "no file %s\t", cf->file_name); + if (l == -1 || l >= (int)sizeof(buf)) + fatal("cvs_status_local: overflow"); + } else + if (strlcpy(buf, cf->file_name, sizeof(buf)) >= sizeof(buf)) + fatal("cvs_status_local: overflow"); + + cvs_printf("File: %-17s\tStatus: %s\n\n", buf, status); if (cf->file_ent == NULL) { l = snprintf(buf, sizeof(buf), |