From 574d7414f105a7c4d0d571ca6302e5f4737aaa5f Mon Sep 17 00:00:00 2001 From: William McBrine Date: Sun, 20 Nov 2005 15:52:08 +0000 Subject: [PATCH] Function hotkey() didn't actually work (just always returned the first letter). --- demos/tui.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/demos/tui.c b/demos/tui.c index ed7767e0..57ea412a 100644 --- a/demos/tui.c +++ b/demos/tui.c @@ -44,7 +44,7 @@ void rmerror (void); #endif #ifdef PDCDEBUG -char *rcsid_tui = "$Id: tui.c,v 1.4 2005/11/20 04:01:00 wmcbrine Exp $"; +char *rcsid_tui = "$Id: tui.c,v 1.5 2005/11/20 15:52:08 wmcbrine Exp $"; #endif #if defined(__unix) && !defined(__DJGPP__) @@ -271,10 +271,10 @@ static int hotkey (s) char *s; #endif { - int c, c0 = *s; /* if no upper case found, return first char */ + int c0 = *s; /* if no upper case found, return first char */ - for (c = *s; c; s++) if (isupper(c)) break; - return c ? c : c0; + for (; *s; s++) if (isupper(*s)) break; + return *s ? *s : c0; } #ifdef __STDC__