diff options
author | Mark Lumsden <lum@cvs.openbsd.org> | 2014-03-22 10:00:59 +0000 |
---|---|---|
committer | Mark Lumsden <lum@cvs.openbsd.org> | 2014-03-22 10:00:59 +0000 |
commit | afb8e74a11873ddcda50f71db0572eb128124f21 (patch) | |
tree | ee3cd88f8ad0bd401115909ab7bc537f77c25cfc | |
parent | 6c13da0e4ed0dcdff429bc14c23727132dc3ebe9 (diff) |
If no default tag defined, still let user input a tag to find.
From Sunil Nimmagadda.
-rw-r--r-- | usr.bin/mg/tags.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/usr.bin/mg/tags.c b/usr.bin/mg/tags.c index b1f3788c442..ec1f875907b 100644 --- a/usr.bin/mg/tags.c +++ b/usr.bin/mg/tags.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tags.c,v 1.8 2014/03/20 07:47:29 lum Exp $ */ +/* $OpenBSD: tags.c,v 1.9 2014/03/22 10:00:58 lum Exp $ */ /* * This file is in the public domain. @@ -146,11 +146,12 @@ findtag(int f, int n) char *tok, *bufp; int ret; - if (curtoken(f, n, dtok) == FALSE) - return (FALSE); - - bufp = eread("Find tag (default %s) ", utok, MAX_TOKEN, - EFNUL | EFNEW, dtok); + if (curtoken(f, n, dtok) == FALSE) { + dtok[0] = '\0'; + bufp = eread("Find tag:", utok, MAX_TOKEN, EFNUL | EFNEW); + } else + bufp = eread("Find tag (default %s):", utok, MAX_TOKEN, + EFNUL | EFNEW, dtok); if (bufp == NULL) return (ABORT); |