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]
Created attachment 109652 [details] [review]
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 <email@example.com>
Keep the generated names for "reallylongfilename (copy).txt" from
overflowing the maximum allowed length for path names.
Original patch by Dave Camp <firstname.lastname@example.org>
(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.
(get_max_name_length): Wrapper around pathconf() for basename lengths.
(get_unique_target_file): Use a maximum length for the target name.