[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug-idutils] [patch #4941] eid /xxx search not working
From: |
Bruce Edge |
Subject: |
[bug-idutils] [patch #4941] eid /xxx search not working |
Date: |
Tue, 28 Feb 2006 23:29:41 +0000 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.1) Gecko/20060224 Ubuntu/dapper Firefox/1.5.0.1 |
URL:
<http://savannah.gnu.org/patch/?func=detailitem&item_id=4941>
Summary: eid /xxx search not working
Project: idutils
Submitted by: bruce_edge
Submitted on: Tue 02/28/06 at 23:29
Category: None
Priority: 5 - Normal
Status: None
Privacy: Public
Assigned to: None
Originator Email:
Open/Closed: Open
_______________________________________________________
Details:
Running eid <var>, then using "/xxx" to skip to the first match of xxx in the
file list is not working.
There's something wrong with the strcasestr loop. I unrolled it and it works
fine now.
This patch is against 3.2.d source pulled down from ubuntu.
-Bruce
--- src/lid.c.orig 2006-02-28 15:06:27.000000000 -0800
+++ src/lid.c 2006-02-28 15:14:11.000000000 -0800
@@ -1069,11 +1069,18 @@
char const *s1p;
char const *s2p;
char const *s1last;
+ char a, b;
- for (s1last = &s1[strlen (s1) - strlen (s2)]; s1 <= s1last; s1++)
- for (s1p = s1, s2p = s2; TOLOWER (*s1p) == TOLOWER (*s2p); s1p++)
- if (*++s2p == '\0')
- return (char *) s1;
+ for (s1last = &s1[strlen (s1) - strlen (s2)]; s1 <= s1last; s1++) {
+ s1p = s1;
+ s2p = s2;
+ for (a = TOLOWER(*s1p), b = TOLOWER(*s2p); a == b; s1p++) {
+ a = TOLOWER(*s1p);
+ b = TOLOWER(*s2p);
+ if (*++s2p == '\0')
+ return (char *) s1;
+ }
+ }
return 0;
}
_______________________________________________________
Reply to this item at:
<http://savannah.gnu.org/patch/?func=detailitem&item_id=4941>
_______________________________________________
Message sent via/by Savannah
http://savannah.gnu.org/
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [bug-idutils] [patch #4941] eid /xxx search not working,
Bruce Edge <=