After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 530844 - When naming duplicates, should respect PATH_MAX
When naming duplicates, should respect PATH_MAX
Status: RESOLVED DUPLICATE of bug 364843
Product: nautilus
Classification: Core
Component: File and Folder Operations
2.22.x
Other Linux
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2008-05-01 03:43 UTC by Hans Petter Jansson
Modified: 2008-05-03 11:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
nautilus-constrain-name-length-for-duplicates.patch (15.05 KB, patch)
2008-05-01 03:44 UTC, Hans Petter Jansson
none Details | Review
Screenshot of the patch in action. (34.78 KB, image/png)
2008-05-01 03:45 UTC, Hans Petter Jansson
  Details
nautilus-constrain-name-length-for-duplicates.patch (15.03 KB, patch)
2008-05-01 05:12 UTC, Hans Petter Jansson
none Details | Review

Description Hans Petter Jansson 2008-05-01 03:43:23 UTC
When you make a copy of a local file and Nautilus appends the text (copy), (another copy) etc, no check is made to see if the resulting name is too long for the file system. We need to check that the name is within the bounds of NAME_MAX and PATH_MAX and crop it accordingly if it isn't.

Dave Camp wrote a patch back in the day that fixes this. We've been using it in openSUSE.

I've rebased the patch for Nautilus 2.22.2 (and probably trunk), and am attaching it here.
Comment 1 Hans Petter Jansson 2008-05-01 03:44:09 UTC
Created attachment 110206 [details] [review]
nautilus-constrain-name-length-for-duplicates.patch
Comment 2 Hans Petter Jansson 2008-05-01 03:45:42 UTC
Created attachment 110207 [details]
Screenshot of the patch in action.

Notice how for long filenames, the attached (copy) text steals from the file name, as it should.
Comment 3 A. Walton 2008-05-01 04:04:42 UTC
Tiny issue (looks like an unused variable) in the @@ -568,13 +655,51 @@ chunk:
+	GnomeVFSURI *uri;
Comment 4 Hans Petter Jansson 2008-05-01 05:12:43 UTC
Created attachment 110209 [details] [review]
nautilus-constrain-name-length-for-duplicates.patch

Revised patch.
Comment 5 A. Walton 2008-05-03 11:02:27 UTC
There's another unused variable in that patch, but furthermore this is a duplicate of 364843, so I'm going to close it. But I'm also going to forward on the patch to the list to make sure it gets reviewed. Thanks for reporting!

*** This bug has been marked as a duplicate of 364843 ***