GNOME Bugzilla – Bug 530844
When naming duplicates, should respect PATH_MAX
Last modified: 2008-05-03 11:02:27 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.
Created attachment 110206 [details] [review] nautilus-constrain-name-length-for-duplicates.patch
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.
Tiny issue (looks like an unused variable) in the @@ -568,13 +655,51 @@ chunk: + GnomeVFSURI *uri;
Created attachment 110209 [details] [review] nautilus-constrain-name-length-for-duplicates.patch Revised patch.
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 ***