summaryrefslogtreecommitdiff
path: root/scripts/lxdialog/util.c
Unidiff
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)
327 wmove (win, y + height, x + 2); 327 wmove (win, y + height, x + 2);
328 for (i = 0; i < width; i++) 328 for (i = 0; i < width; i++)
329 waddch (win, winch (win) & A_CHARTEXT); 329 waddch (win, winch (win) & A_CHARTEXT);
330 for (i = y + 1; i < y + height + 1; i++) { 330 for (i = y + 1; i < y + height + 1; i++) {
331 wmove (win, i, x + width); 331 wmove (win, i, x + width);
332 waddch (win, winch (win) & A_CHARTEXT); 332 waddch (win, winch (win) & A_CHARTEXT);
333 waddch (win, winch (win) & A_CHARTEXT); 333 waddch (win, winch (win) & A_CHARTEXT);
334 } 334 }
335 wnoutrefresh (win); 335 wnoutrefresh (win);
336 } 336 }
337} 337}
338 338
339/* 339/*
340 * Return the position of the first alphabetic character in a string. 340 * Return the position of the first alphabetic character in a string.
341 */ 341 */
342int 342int
343first_alpha(const char *string, const char *exempt) 343first_alpha(const char *string, const char *exempt)
344{ 344{
345 int i, in_paren=0, c; 345 int i, in_paren=0, c;
346 346
347 for (i = 0; i < strlen(string); i++) { 347 for (i = 0; i < strlen(string); i++) {
348 c = tolower(string[i]); 348 c = tolower(string[i]);
349 349
350 if (strchr("<[(", c)) ++in_paren; 350 if (strchr("<[(", c)) ++in_paren;
351 if (strchr(">])", c)) --in_paren; 351 if (strchr(">])", c) && in_paren > 0) --in_paren;
352 352
353 if ((! in_paren) && isalpha(c) && 353 if ((! in_paren) && isalpha(c) &&
354 strchr(exempt, c) == 0) 354 strchr(exempt, c) == 0)
355 return i; 355 return i;
356 } 356 }
357 357
358 return 0; 358 return 0;
359} 359}