Bug 106648 - 3.4.1 fish know detects directories ending in ".cc" as c++ files instead of actually directories
Summary: 3.4.1 fish know detects directories ending in ".cc" as c++ files instead of a...
Status: RESOLVED FIXED
Alias: None
Product: kio
Classification: Frameworks and Libraries
Component: fish (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR major
Target Milestone: ---
Assignee: Jörg Walter
URL:
Keywords:
: 107219 108105 108272 110646 112347 116707 121773 124421 131953 137834 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-06-02 02:06 UTC by Joseph Roback
Modified: 2006-11-24 20:12 UTC (History)
12 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joseph Roback 2005-06-02 02:06:20 UTC
Version:            (using KDE KDE 3.4.1)
Installed from:    Gentoo Packages
Compiler:          gcc version 3.3.5-20050130 (Gentoo Linux 3.3.5.20050130-r1, ssp-3.3.5.20050130-1, pie-8.7.7.1) 
OS:                Linux

I have a remote server with a directories that end in ".cc", like roback.cc and developer.roback.cc, they are domain names. In <=KDE3.4.0 fish worked fine, but in 3.4.1 fish detects them as C++ source files instead of directories.

http://www.roback.cc/tmp/fish_bug3.png is a screenshot of the bug in KDE3.4.1 with sftp displaying the directories correctly.

cheers
Comment 1 Nicolas Goutte 2005-06-13 17:20:55 UTC
*** Bug 107219 has been marked as a duplicate of this bug. ***
Comment 2 Maksim Orlovich 2005-06-25 15:33:03 UTC
*** Bug 108105 has been marked as a duplicate of this bug. ***
Comment 3 hads 2005-06-29 07:15:04 UTC
Indeed this problem affects any directory with a name that is recognised as an known extension. A lot of the directories on my server end in .au and this opens as a Sun audio file. Seems only to affect the fish:/ slave.

Using Arch Linux with KDE 3.4.1
Comment 4 Nicolas Goutte 2005-06-29 15:55:53 UTC
*** Bug 108272 has been marked as a duplicate of this bug. ***
Comment 5 Nicolas Goutte 2005-06-29 21:24:07 UTC
After thinking more, I am reverting the status of duplication of bug #108272. 
The reason is that #106648 can be solved in another way by testing that the 
filenmae check should be careful about not finding an extension when its is 
the only file name.

However bug #1
Comment 6 Thiago Macieira 2005-07-01 04:31:45 UTC
*** Bug 108272 has been marked as a duplicate of this bug. ***
Comment 7 Thiago Macieira 2005-08-13 05:02:50 UTC
*** Bug 110646 has been marked as a duplicate of this bug. ***
Comment 8 Thiago Macieira 2005-08-13 05:04:14 UTC
Confirming (3.5 r440440) and raising severity.
Comment 9 Nicolas Goutte 2005-09-10 15:31:30 UTC
*** Bug 112347 has been marked as a duplicate of this bug. ***
Comment 10 Nicolas Goutte 2005-11-19 16:25:45 UTC
*** Bug 116707 has been marked as a duplicate of this bug. ***
Comment 11 T.R.Shashwath 2005-12-01 14:07:59 UTC
Happens for me using fish on 3.4.2, compiled from Gentoo ebuilds. Specifically with directories called .qt and .java...
Comment 12 Nicolas Goutte 2006-02-12 21:04:49 UTC
*** Bug 121773 has been marked as a duplicate of this bug. ***
Comment 13 Nicolas Goutte 2006-02-22 10:40:24 UTC
See alo bug #122455 (I am not sure that it is exactly the same problem but it is a imilar symptom).
Comment 14 Thiago Macieira 2006-02-25 21:18:56 UTC
*** Bug 122455 has been marked as a duplicate of this bug. ***
Comment 15 Maksim Orlovich 2006-03-28 16:47:04 UTC
*** Bug 124421 has been marked as a duplicate of this bug. ***
Comment 16 Andreas Kling 2006-08-06 14:02:20 UTC
*** Bug 131953 has been marked as a duplicate of this bug. ***
Comment 17 Andreas Kling 2006-08-06 15:14:12 UTC
SVN commit 570332 by kling:

If remote says it's a directory, go with that instead of guessing the mimetype based on filename.

BUG: 106648


 M  +12 -5     fish.cpp  


--- branches/KDE/3.5/kdebase/kioslave/fish/fish.cpp #570331:570332
@@ -962,18 +962,25 @@
                     errorCount--;
                     break;
 
-                case 'M':
+                case 'M': {
+                    QString type = line.mid(1);
+
+                    // First thing's first. If remote says this is a directory, throw out any
+                    // name-based file type guesses.
+                    if (type == "inode/directory" && mimeAtom.m_str != type) {
+                        mimeAtom.m_str = type;
+                        typeAtom.m_long = S_IFDIR;
+                    }
                     // This is getting ugly. file(1) makes some uneducated
                     // guesses, so we must try to ignore them (#51274)
-                    if (mimeAtom.m_str.isEmpty() && line.right(8) != "/unknown" &&
+                    else if (mimeAtom.m_str.isEmpty() && line.right(8) != "/unknown" &&
                             (thisFn.find('.') < 0 || (line.left(8) != "Mtext/x-"
                                                   && line != "Mtext/plain"))) {
-                        mimeAtom.m_str = line.mid(1);
-                        if ( mimeAtom.m_str == "inode/directory" ) // a symlink to a dir is a dir
-                          typeAtom.m_long = S_IFDIR;
+                        mimeAtom.m_str = type;
                     }
                     errorCount--;
                     break;
+                }
 
                 case 'L':
                     atom.m_uds = UDS_LINK_DEST;
Comment 18 Bram Schoenmakers 2006-11-24 20:12:26 UTC
*** Bug 137834 has been marked as a duplicate of this bug. ***