summaryrefslogtreecommitdiff
path: root/sys/ddb
diff options
context:
space:
mode:
authorNiklas Hallqvist <niklas@cvs.openbsd.org>2001-02-08 23:06:33 +0000
committerNiklas Hallqvist <niklas@cvs.openbsd.org>2001-02-08 23:06:33 +0000
commit185d74010b6e2c84788d28271c16a0598d4e9b83 (patch)
treec02875265eca9c39c0517556def0d24903d1f6ac /sys/ddb
parent421781c5e7b1161ccc03d45bf6b2978fc3f15de5 (diff)
Capital punishment, just in case :-)
Diffstat (limited to 'sys/ddb')
-rw-r--r--sys/ddb/db_hangman.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/sys/ddb/db_hangman.c b/sys/ddb/db_hangman.c
index 790afe2121c..8a0b3a4ab23 100644
--- a/sys/ddb/db_hangman.c
+++ b/sys/ddb/db_hangman.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: db_hangman.c,v 1.14 2000/04/05 21:54:48 mickey Exp $ */
+/* $OpenBSD: db_hangman.c,v 1.15 2001/02/08 23:06:32 niklas Exp $ */
/*
* Copyright (c) 1996 Theo de Raadt, Michael Shalayeff
@@ -121,8 +121,8 @@ db_hang(tries, word, abc)
}
for (p = word; *p; p++)
- if (ISALPHA(*p))
- cnputc(abc[TOLOWER(*p) - 'a']);
+ if (ISALPHA(*p) && abc[TOLOWER(*p) - 'a'] == '-')
+ cnputc('-');
else
cnputc(*p);
@@ -158,23 +158,23 @@ db_hangon(void)
}
{
- register char c, c1;
+ register char c;
db_hang(tries, word, abc);
- c1 = cngetc();
+ c = cngetc();
+ c = TOLOWER(c);
- c = TOLOWER(c1);
if (ISALPHA(c) && abc[c - 'a'] == '-') {
register char *p;
register size_t n;
/* strchr(word,c) */
for (n = 0, p = word; *p ; p++)
- if (*p == c)
+ if (TOLOWER(*p) == c)
n++;
if (n) {
- abc[c - 'a'] = c1;
+ abc[c - 'a'] = c;
len -= n;
} else {
abc[c - 'a'] = '_';