Closed Bug 668725 Opened 13 years ago Closed 10 years ago

nsMIMEInfoOS2::LoadUriInternal(), nsOSHelperAppService::OSProtocolHandlerExists() and nsOSHelperAppService::GetApplicationDescription() access wrong pref

Categories

(Core Graveyard :: File Handling, defect)

x86
OS/2
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: masayuki, Unassigned)

References

Details

Attachments

(1 file)

nsMIMEInfoOS2::LoadUriInternal(), nsOSHelperAppService::OSProtocolHandlerExists() and nsOSHelperAppService::GetApplicationDescription() are now have following code.

nsCAutoString prefName = branchName + branchName;
nsAdoptingCString prefString = Preferences::GetCString(prefName.get());

The pref name is very strange. Old code (pre bug 666903) got the branch of the branchName and passes the branchName to nsIPrefBranch::GetCharPref() again. Therefore, the branch accessed branchName + branchName.
Component: Document Navigation → File Handling
QA Contact: docshell → file-handling
This unbreaks the build w/o correcting yet the code that is in doubt.
(In reply to Masayuki Nakano (Mozilla Japan) from comment #0)
> nsMIMEInfoOS2::LoadUriInternal(),
> nsOSHelperAppService::OSProtocolHandlerExists() and
> nsOSHelperAppService::GetApplicationDescription() are now have following
> code.
> 
> nsCAutoString prefName = branchName + branchName;
> nsAdoptingCString prefString = Preferences::GetCString(prefName.get());
> 
> The pref name is very strange. Old code (pre bug 666903) got the branch of
> the branchName and passes the branchName to nsIPrefBranch::GetCharPref()
> again. Therefore, the branch accessed branchName + branchName.

The code in question was introduced in bug390075
here's the checkin log
http://bonsai.mozilla.org/cvsview2.cgi?diff_mode=context&whitespace_mode=show&root=/cvsroot&subdir=mozilla/uriloader/exthandler/os2&command=DIFF_FRAMESET&file=nsMIMEInfoOS2.cpp&rev2=1.12&rev1=1.11

Peter, since you introduced the code, you may have an idea (when looking at the link above) why you solved the problem of bug390075 the way you did.
Target Milestone: --- → mozilla8
Version: Trunk → Other Branch
Target Milestone: mozilla8 → ---
Version: Other Branch → Trunk
I'm pretty sure that my cde did not do the equivalent of branchName + branchName. AFAICT it got the pref branch, then used GetCharPref() on it to access the content of the pref. It could have been wrong or not very elegant, but nobody ever complained that it did not work...
Yes, but it included the path to the pref in both the branch it got and the pref name it used.  From http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/uriloader/exthandler/os2/nsMIMEInfoOS2.cpp&rev=1.12&root=/cvsroot :

180 rv = thePrefsService->GetBranch(prefName.get(), getter_AddRefs(prefBranch));
...
183 rv = prefBranch->GetCharPref(prefName.get(), getter_Copies(prefString));

That is _exactly_ concatenating prefName with itself.

I can totally believe that no one tried using it, hence never complained it didn't work...
Well, surely _you_ never used it...

Anyway, apparently I and two other people were wrong in 2007, so someone please fix so that it does whatever it was meant to do (which was apparently the "applications.epm" trick as listed on <http://www.os2bbs.com/os2news/Warpzilla.html>).
Sorry, but OS/2 support has been removed from mozilla-central (bug 969757).
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → WONTFIX
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: