DNS: internet keywords fail if dot character found (two line patch provides oodles of functionality)

VERIFIED DUPLICATE of bug 79655

Status

SeaMonkey
Location Bar
VERIFIED DUPLICATE of bug 79655
17 years ago
10 years ago

People

(Reporter: m_mozilla, Assigned: Joe Hewitt (gone))

Tracking

Trunk
PowerPC
Mac OS X

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

17 years ago
ideal world:
    set internet keywords to use google for searches
    set default search engine to search bugzilla
    set url-autocomplete to show search (with bugzilla)
    get rid of search button on URL toolbar because keywords does it for me

actual world:
    the above works just fine except when you try to search for
        +site:foo.com download
      or
        Mr. Ed
    or something like that (note the '.' in each of those)
    in which case Mozilla thinks you have a url and not a keyword search

It seems that "a dot in the URL bar" is a bit too simple. The relevent code is 

http://lxr.mozilla.org/seamonkey/source/docshell/base/nsWebShell.cpp#957 wrote:
957> PRInt32 dotLoc = hostStr.FindChar('.');
 :
994> if(keywordsEnabled && (-1 == dotLoc)) {


I'm not sure what sort of regular expression library is available in C, but I
can tell from empirical testing that Mozilla strips off initial and trailing
whitespace, and I'm guessing that happens before the above line 994. So, a very
very nice first step might be as simple as doing a FindChar to see if we find a
space. The previous line 994 becomes the following two lines:

994> PRInt32 spaceLoc = hostStr.FindChar(' ');
995> if(  keywordsEnabled  &&  ( (spaceLoc > -1) || (-1 == dotLoc) )  ) {
    
This would enable *very* convenient searching from the URL bar for a whole class
of searches which are currently not possible.

I'd make a patch, but I don't yet have the source on my machine, and I'm hoping
that this is a trivial patch to create for someone who has already been writting
patches.

-matt

Comment 1

17 years ago
Resolving as duplicate of bug 79655
Please reopen if you disagree with this resolution.

*** This bug has been marked as a duplicate of 79655 ***
Status: NEW → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → DUPLICATE

Comment 2

16 years ago
VERIFIED:
This is a DNS parsing issue, so I'm verifying it.

Claudius, I'll take QA ownership too, if you don't mind.
Status: RESOLVED → VERIFIED
QA Contact: claudius → benc
Summary: internet keywords fail if dot character found (two line patch provides oodles of functionality) → DNS: internet keywords fail if dot character found (two line patch provides oodles of functionality)
Product: Core → SeaMonkey
You need to log in before you can comment on or make changes to this bug.