summaryrefslogtreecommitdiff
path: root/scripts/lxdialog/util.c
Side-by-side diff
Diffstat (limited to 'scripts/lxdialog/util.c') (more/less context) (ignore whitespace changes)
-rw-r--r--scripts/lxdialog/util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/lxdialog/util.c b/scripts/lxdialog/util.c
index b3a7af9..e7bce9b 100644
--- a/scripts/lxdialog/util.c
+++ b/scripts/lxdialog/util.c
@@ -327,33 +327,33 @@ draw_shadow (WINDOW * win, int y, int x, int height, int width)
wmove (win, y + height, x + 2);
for (i = 0; i < width; i++)
waddch (win, winch (win) & A_CHARTEXT);
for (i = y + 1; i < y + height + 1; i++) {
wmove (win, i, x + width);
waddch (win, winch (win) & A_CHARTEXT);
waddch (win, winch (win) & A_CHARTEXT);
}
wnoutrefresh (win);
}
}
/*
* Return the position of the first alphabetic character in a string.
*/
int
first_alpha(const char *string, const char *exempt)
{
int i, in_paren=0, c;
for (i = 0; i < strlen(string); i++) {
c = tolower(string[i]);
if (strchr("<[(", c)) ++in_paren;
- if (strchr(">])", c)) --in_paren;
+ if (strchr(">])", c) && in_paren > 0) --in_paren;
if ((! in_paren) && isalpha(c) &&
strchr(exempt, c) == 0)
return i;
}
return 0;
}