patchidutils - Patches: patch #4941, eid /xxx search not working


You are not allowed to post comments on this tracker with your current authentication level.

patch #4941: eid /xxx search not working

Submitter:  Bruce Edge <bruce_edge>
Submitted:  Tue 28 Feb 2006 11:29:40 PM UTC
Category:  None Priority:  5 - Normal
Status:  Need Info Privacy:  Public
Assigned to:  sick_soul Open/Closed:  Open

Wed 01 Mar 2006 11:07:08 PM UTC, comment #1: 

Hello Bruce,
thanks for your report.

Could you give a more detailed example of what you expect,
and what you obtain instead?

It would also help if you try with the latest release (4.0)
available on

or with the current CVS code (see savannah CVS page for instructions).

I've tried some lid -R edit with / and it works for me.
Could you also share the value of your VISUAL and EDITOR environment variables if any?



Claudio Fontana <sick_soul>
Tue 28 Feb 2006 11:29:40 PM UTC, original submission:  

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.


--- 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;

Bruce Edge <bruce_edge>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


CC list is empty


There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.


Follow 2 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2006-03-01 sick_soul StatusNone Need Info
    Assigned toNone sick_soul

Back to the top

Powered by Savane 3.13-ee12.
Corresponding source code