GNOME Bugzilla – Bug 364843
Keep "reallylongfilename (copy).txt" from reaching the maximum path length
Last modified: 2008-05-08 19:32:20 UTC
The various names that get generated for copied files ("file (copy).txt") can overflow the maximum allowed length for pathnames. The attached patch fixes this.
Created attachment 75333 [details] [review] nautilus-name-length.patch
Created attachment 109652 [details] [review] nautilus-bgo364843-name-copy-dont-overflow-max-path-len.diff This one is updated for nautilus-2.22.2.
*** Bug 530844 has been marked as a duplicate of this bug. ***
Thanks for your efforts. Please commit it to trunk and the GNOME 2.22 branch.
Thanks, Manny! Submitted to trunk and GNOME_2_22. 2008-05-08 Federico Mena Quintero <federico@novell.com> http://bugzilla.gnome.org/show_bug.cgi?id=364843 Keep the generated names for "reallylongfilename (copy).txt" from overflowing the maximum allowed length for path names. Original patch by Dave Camp <campd@campd.org> * libnautilus-private/nautilus-file-operations.c (shorten_utf8_string): New function; takes an UTF8 string and hygienically truncates it to a given number of bytes. (get_link_name): Ensure the final name doesn't exceed a maximum length. (make_next_duplicate_name): Likewise. (get_max_name_length): Wrapper around pathconf() for basename lengths. (get_unique_target_file): Use a maximum length for the target name. (get_target_file_for_link): Likewise.