Bug 437333 - Case insensitive search doesn't work if search term includes upper-case characters
Summary: Case insensitive search doesn't work if search term includes upper-case chara...
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: less (Show other bugs)
(Show other bugs)
Version: 8
Hardware: All Linux
low
low
Target Milestone: ---
Assignee: Zdenek Prikryl
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-03-13 16:14 UTC by Stephen Warren
Modified: 2008-03-13 16:24 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-03-13 16:24:43 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

Description Stephen Warren 2008-03-13 16:14:53 UTC
Description of problem:
Case insensitive search doesn't work if search term includes upper-case characters.

Version-Release number of selected component (if applicable):
less-406-14.fc8.i386

How reproducible:
Always

Steps to Reproduce:
1. $ less somefile
2. Assume the file actually contains "int someLongVarName;"
3. /someLongVarName<ENTER>   [i.e. search with correct case]
4. Note that the text is found in the file
5. -i [i.e. switch to case-insensitive search]
6. /someLongVarName<ENTER>   [i.e. search with correct case]
7. Note that the string could not be found!
8. /somelongvarname<ENTER>   [i.e. search with correct case]
9. Note that the string is again found if the search term is entered lower case.
 
Actual results:
Case insensitive search doesn't work if search term entered by user isn't all
lower case.

Expected results:
When in case-insensitive search mode, both the file content and the search term
should be lower-cased prior to comparison.

Additional info:
This was extremely confusing until I worked out what the problem was; it looked
like less's search was completely broken!

Comment 1 Stephen Warren 2008-03-13 16:21:56 UTC
I need to modify the repro steps a little.

In step 6, if you search for the exact correct mixed-case string, it still works
in "ignore case" mode.

However, if you search for something that's still mixed-case, but with a
different case mix than the file text it fails.

So, step 6 should be:

6. /somelongvarName<ENTER>   [i.e. search with mismatching case]
        ^   ^


Comment 2 Stephen Warren 2008-03-13 16:24:43 UTC
Sigh. And now I worked that out, it seems that what I want is "-I" mode, not
"-i" mode; it's behaving as documented. I'm never going to remember that...

So, closing the bug.



Note You need to log in before you can comment on or make changes to this bug.