File src/mainfunction.c changed (mode: 100644) (index 60a46d4..2b82e8b) |
... |
... |
work(char ***message, char **type, long *lines, FILE * id, int tag_table_pos) |
546 |
546 |
curs_set(0); |
curs_set(0); |
547 |
547 |
noecho(); |
noecho(); |
548 |
548 |
attrset(normal); |
attrset(normal); |
549 |
|
pinfo_re_comp(token); /* compile the read token */ |
|
|
549 |
|
/* compile the read token */ |
|
550 |
|
if (pinfo_re_comp(token) != 0) |
|
551 |
|
{ |
|
552 |
|
/* print error message */ |
|
553 |
|
attrset(bottomline); |
|
554 |
|
mymvhline(maxy - 1, 0, ' ', maxx); |
|
555 |
|
move(maxy - 1, 0); |
|
556 |
|
printw(_("Invalid regular expression;")); |
|
557 |
|
printw(" "); |
|
558 |
|
printw(_("Press any key to continue...")); |
|
559 |
|
getch(); |
|
560 |
|
goto skip_search; |
|
561 |
|
|
|
562 |
|
} |
550 |
563 |
/* scan for the token in the following lines. */ |
/* scan for the token in the following lines. */ |
551 |
564 |
for (i = pos + 1; i < Lines; i++) |
for (i = pos + 1; i < Lines; i++) |
552 |
565 |
{ |
{ |
File src/manual.c changed (mode: 100644) (index 56c92ab..f9962aa) |
... |
... |
manualwork() |
1120 |
1120 |
#endif |
#endif |
1121 |
1121 |
attrset(normal); |
attrset(normal); |
1122 |
1122 |
/* compile regexp expression */ |
/* compile regexp expression */ |
1123 |
|
pinfo_re_comp(token); |
|
|
1123 |
|
if (pinfo_re_comp(token) != 0) |
|
1124 |
|
{ |
|
1125 |
|
/* print error message */ |
|
1126 |
|
attrset(bottomline); |
|
1127 |
|
mymvhline(maxy - 1, 0, ' ', maxx); |
|
1128 |
|
move(maxy - 1, 0); |
|
1129 |
|
printw(_("Invalid regular expression;")); |
|
1130 |
|
printw(" "); |
|
1131 |
|
printw(_("Press any key to continue...")); |
|
1132 |
|
getch(); |
|
1133 |
|
goto skip_search; |
|
1134 |
|
} |
1124 |
1135 |
/* and search for it in all subsequential lines */ |
/* and search for it in all subsequential lines */ |
1125 |
1136 |
for (i = manualpos + 1; i < ManualLines - 1; i++) |
for (i = manualpos + 1; i < ManualLines - 1; i++) |
1126 |
1137 |
{ |
{ |
File src/utils.c changed (mode: 100644) (index 690336f..59bd05d) |
... |
... |
waitforgetch() |
353 |
353 |
select(1, &rdfs, NULL, NULL, NULL); |
select(1, &rdfs, NULL, NULL, NULL); |
354 |
354 |
} |
} |
355 |
355 |
|
|
356 |
|
void |
|
|
356 |
|
/* returns 0 on success, 1 on error */ |
|
357 |
|
int |
357 |
358 |
pinfo_re_comp(char *name) |
pinfo_re_comp(char *name) |
358 |
359 |
{ |
{ |
359 |
360 |
#ifdef ___DONT_USE_REGEXP_SEARCH___ |
#ifdef ___DONT_USE_REGEXP_SEARCH___ |
|
... |
... |
pinfo_re_comp(char *name) |
363 |
364 |
pinfo_re_pattern = 0; |
pinfo_re_pattern = 0; |
364 |
365 |
} |
} |
365 |
366 |
pinfo_re_pattern = strdup(name); |
pinfo_re_pattern = strdup(name); |
|
367 |
|
return 0; |
366 |
368 |
#else |
#else |
367 |
369 |
if (pinfo_re_offset == -1) |
if (pinfo_re_offset == -1) |
368 |
370 |
{ |
{ |
|
... |
... |
pinfo_re_comp(char *name) |
376 |
378 |
{ |
{ |
377 |
379 |
regfree(&h_regexp[pinfo_re_offset]); |
regfree(&h_regexp[pinfo_re_offset]); |
378 |
380 |
} |
} |
379 |
|
regcomp(&h_regexp[pinfo_re_offset], name, REG_ICASE); |
|
|
381 |
|
return regcomp(&h_regexp[pinfo_re_offset], name, REG_ICASE); |
380 |
382 |
#endif |
#endif |
381 |
383 |
} |
} |
382 |
384 |
|
|
File src/utils.h changed (mode: 100644) (index 5294cde..8e4c674) |
... |
... |
extern char *pinfo_re_pattern; |
13 |
13 |
#endif |
#endif |
14 |
14 |
|
|
15 |
15 |
/* wrappers for re_comp and re_exec */ |
/* wrappers for re_comp and re_exec */ |
16 |
|
void pinfo_re_comp (char *name); |
|
|
16 |
|
int pinfo_re_comp (char *name); |
17 |
17 |
int pinfo_re_exec (char *name); |
int pinfo_re_exec (char *name); |
18 |
18 |
|
|
19 |
19 |
/* user defined getch, capable of handling ALT keybindings */ |
/* user defined getch, capable of handling ALT keybindings */ |