|
From: Hans-Bernhard B. <br...@us...> - 2002-06-20 16:26:32
|
Update of /cvsroot/cscope/cscope/src
In directory usw-pr-cvs1:/tmp/cvs-serv27183/src
Modified Files:
find.c
Log Message:
Fix -C -L mode: lowercase pattern before using it
Index: find.c
===================================================================
RCS file: /cvsroot/cscope/cscope/src/find.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -r1.14 -r1.15
*** find.c 13 Mar 2002 18:54:40 -0000 1.14
--- find.c 20 Jun 2002 16:26:29 -0000 1.15
***************
*** 598,612 ****
/* remove trailing white space */
! for (s = pattern + strlen(pattern) - 1; isspace((unsigned char)*s); --s) {
*s = '\0';
}
/* allow a partial match for a file name */
if (field == FILENAME || field == INCLUDES) {
-
if (regcomp (®exp, pattern, REG_EXTENDED | REG_NOSUB) != 0) {
return(REGCMPERROR);
! }
! else
! {
isregexp_valid = YES;
}
--- 598,619 ----
/* remove trailing white space */
! for (s = pattern + strlen(pattern) - 1;
! isspace((unsigned char)*s);
! --s) {
*s = '\0';
}
+
+ /* HBB 20020620: new: make sure pattern is lowercased. Curses
+ * mode gets this right all on its own, but at least -L mode
+ * doesn't */
+ if (caseless == YES) {
+ pattern = lcasify(pattern);
+ }
+
/* allow a partial match for a file name */
if (field == FILENAME || field == INCLUDES) {
if (regcomp (®exp, pattern, REG_EXTENDED | REG_NOSUB) != 0) {
return(REGCMPERROR);
! } else {
isregexp_valid = YES;
}
***************
*** 616,621 ****
if (strpbrk(pattern, "^.[{*+$") != NULL) {
isregexp = YES;
! }
! else {
/* check for a valid C symbol */
s = pattern;
--- 623,627 ----
if (strpbrk(pattern, "^.[{*+$") != NULL) {
isregexp = YES;
! } else {
/* check for a valid C symbol */
s = pattern;
|