Closed Bug 646306 Opened 13 years ago Closed 13 years ago

file is not defined in DirInstallLocation__readDirectoryFromFile

Categories

(Toolkit :: Add-ons Manager, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla7

People

(Reporter: timeless, Assigned: Unfocused)

References

()

Details

Attachments

(1 file, 1 obsolete file)

Mozilla/5.0 (Windows NT 6.1; rv:2.2a1pre) Gecko/20110329 Firefox/4.2a1pre

Warning: WARN addons.xpi: Failed to add directory install location app-profile: ReferenceError: file is not defined
Source File: resource://gre/modules/XPIProvider.jsm
Line: 6882

902   _readDirectoryFromFile: function DirInstallLocation__readDirectoryFromFile(aFile) {
6903     let fis = Cc["@mozilla.org/network/file-input-stream;1"].
6904               createInstance(Ci.nsIFileInputStream);
6905     fis.init(aFile, -1, -1, false);
6906     let line = { value: "" };
6907     if (fis instanceof Ci.nsILineInputStream)
6908       fis.readLine(line);
6909     fis.close();
6910     if (line.value) {
6911       let linkedDirectory = Cc["@mozilla.org/file/local;1"].
6912                             createInstance(Ci.nsILocalFile);
6913 
6914       try {
6915         linkedDirectory.initWithPath(line.value);
6916       }
6917       catch (e) {
6918         linkedDirectory.setRelativeDescriptor(file.parent, line.value);

'aFile' is defined in this function, 'file' is not...
Attached patch Patch v1 (obsolete) — Splinter Review
Disclaimer: I have no clue when it comes to testing this.
Assignee: nobody → bmcbride
Status: NEW → ASSIGNED
Attachment #522901 - Flags: review?(dtownsend)
test_filepointer.js would be a good guide, it looks like it'll be failing right now if the pointer file contains a relative path.
Comment on attachment 522901 [details] [diff] [review]
Patch v1

Looks good, would very much like to see a test for this case though
Attachment #522901 - Flags: review?(dtownsend) → review+
fwiw i hit this using unpacked omni.jar
Keywords: checkin-needed
Needs a test before landing
Keywords: checkin-needed
Attached patch Patch v1.1Splinter Review
Now with test.
Attachment #522901 - Attachment is obsolete: true
Attachment #536227 - Flags: review?(dtownsend)
OS: Windows 7 → All
Hardware: x86 → All
Comment on attachment 536227 [details] [diff] [review]
Patch v1.1

Review of attachment 536227 [details] [diff] [review]:
-----------------------------------------------------------------

Awesome, thanks
Attachment #536227 - Flags: review?(dtownsend) → review+
http://hg.mozilla.org/mozilla-central/rev/c5e0aaaff9e1
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Flags: in-testsuite+
Flags: in-litmus-
Resolution: --- → FIXED
Target Milestone: --- → mozilla7
Verified fixed by check-in and passing tests.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: