Closed Bug 314584 Opened 20 years ago Closed 20 years ago

symlink in ftp:// URL shows as 'folder' because both TYPE_DIRECTORY and TYPE_SYMLINK point to resource://gre/res/html/gopher-menu.gif

Categories

(Firefox :: General, defect)

All
NetBSD
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 133835

People

(Reporter: ggm, Unassigned)

References

()

Details

User-Agent: Mozilla/5.0 (X11; U; NetBSD i386; en-US; rv:1.7.12) Gecko/20050923 Firefox/1.0.7 Build Identifier: Mozilla/5.0 (X11; U; NetBSD i386; en-US; rv:1.7.12) Gecko/20050923 Firefox/1.0.7 So you've done this FTP "DIR" command, and back-parsed the UNIX format ls -l listing to find leading 'd' for directory, or 'l' for symlink, and worked out its a symlink, and even recorded it as TYPE_SYMLINK. And then what does nsIndexedToHTML::OnIndexAvailable do? It says: HAH. BWAH HA HA HA AHAA! sucker. I don't care, lets show DIR and SYMLINK the same, as a gopher_menu.gif instance. [go figure, thats the cheapest path in resource://gre/res/html/ to a 'folder' icon] Don't believe me? Here's the code in netwerk/streamconv/converters/nsIndexedToHTML.cpp (line 532) switch (type) { case nsIDirIndex::TYPE_DIRECTORY: case nsIDirIndex::TYPE_SYMLINK: pushBuffer.Append(NS_LITERAL_STRING("resource://gre/res/html/gopher-menu .gif\" alt=\"Directory: ")); break; case nsIDirIndex::TYPE_FILE: case nsIDirIndex::TYPE_UNKNOWN: pushBuffer.Append(NS_LITERAL_STRING("resource://gre/res/html/gopher-unkn own.gif\" alt=\"File: ")); break; } Reproducible: Always Actual Results: well blow me! I see italicized text, but the icon is a directory even if the symlink target is a file. what a h00t! Expected Results: exactly what I expected. but hey, its not a big bug, so its not a big problem. and I got what I paid for. the code should have used another icon. you could be devious and walk the symlink dest and test its file extension but thats a looser game. Just use another icon from the resource://gre/res/html/ family. How about gopher-unknown.gif? ok, its boringly white, but its not a directory. Ooops! thats used by the files. Hmm. ok, so the gopher-find.gif is a pair of binoculars, but that kinda makes sense: find the symlink (by walking it) ... so code like: --- netwerk/streamconv/converters/nsIndexedToHTML.cpp.dist 2005-11-01 16:30:34.000000000 +1000 +++ netwerk/streamconv/converters/nsIndexedToHTML.cpp 2005-11-01 16:31:15.000000000 +1000 @@ -529,9 +529,11 @@ switch (type) { case nsIDirIndex::TYPE_DIRECTORY: - case nsIDirIndex::TYPE_SYMLINK: pushBuffer.Append(NS_LITERAL_STRING("resource://gre/res/html/gopher-menu.gif\" alt=\"Directory: ")); break; + case nsIDirIndex::TYPE_SYMLINK: + pushBuffer.Append(NS_LITERAL_STRING("resource://gre/res/html/gopher-find.gif\" alt=\"Directory: ")); + break; case nsIDirIndex::TYPE_FILE: case nsIDirIndex::TYPE_UNKNOWN: pushBuffer.Append(NS_LITERAL_STRING("resource://gre/res/html/gopher-unknown.gif\" alt=\"File: "));
Duplicate of Core bug 133835?
yes. it is a duplicate. BUT I SUBMITTED A PATCH!!!! -George
Please do post your patch to bug 133835! *** This bug has been marked as a duplicate of 133835 ***
Status: UNCONFIRMED → RESOLVED
Closed: 20 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.