eid prompt /<regexp> functionality broken
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
id-utils (Debian) |
Fix Released
|
Unknown
|
|||
id-utils (Ubuntu) |
Fix Released
|
Low
|
MOTU |
Bug Description
Binary package hint: id-utils
$> eid MAX_NUM_
MAX_NUM_
edit? [y1-9^S/nq] /test
edit? [y1-9^S/nq] /dev
edit? [y1-9^S/nq] q
The above "/test" should have opened vi on dev_test_
The "/dev" should have opened the first file.
The "/" syntax stated that it will edit the first file that matches the following regex.
Instead it just re-issues the prompt.
This has been broken a long time in debian and ubuntu.
Here's a patch:
--- 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;
}
Changed in id-utils: | |
status: | Unknown → Unconfirmed |
Changed in id-utils: | |
status: | Unconfirmed → Fix Released |
Forwarded to Debian ... Thanks for reporting this.