diff options
author | Cosimo Cecchi <cosimoc@gnome.org> | 2013-08-16 18:32:50 +0200 |
---|---|---|
committer | Cosimo Cecchi <cosimoc@gnome.org> | 2013-08-16 18:38:33 +0200 |
commit | 8ff0bf18f9db9ec328b6c0c460ca2d9c462ddbdd (patch) | |
tree | e20546f138c8c2be7c8867af93a3b4ff1726a8c7 /libnautilus-private/nautilus-file-operations.c | |
parent | 16ea52970d059a1c03dc1ce27dc78f067421dc92 (diff) | |
download | nautilus-8ff0bf18f9db9ec328b6c0c460ca2d9c462ddbdd.tar.gz |
file-operations: replace control characters for FAT fs operations
Those are invalid - if we find one, replace it with an underscore as
well.
https://bugzilla.gnome.org/show_bug.cgi?id=706131
Diffstat (limited to 'libnautilus-private/nautilus-file-operations.c')
-rw-r--r-- | libnautilus-private/nautilus-file-operations.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libnautilus-private/nautilus-file-operations.c b/libnautilus-private/nautilus-file-operations.c index 7002d88ea..fccccf60d 100644 --- a/libnautilus-private/nautilus-file-operations.c +++ b/libnautilus-private/nautilus-file-operations.c @@ -3080,16 +3080,16 @@ get_max_name_length (GFile *file_dir) #define FAT_FORBIDDEN_CHARACTERS "/:;*?\"<>" static gboolean -str_replace (char *str, - const char *chars_to_replace, - char replacement) +fat_str_replace (char *str, + char replacement) { gboolean success; int i; success = FALSE; for (i = 0; str[i] != '\0'; i++) { - if (strchr (chars_to_replace, str[i])) { + if (strchr (FAT_FORBIDDEN_CHARACTERS, str[i]) || + str[i] < 32) { success = TRUE; str[i] = replacement; } @@ -3110,7 +3110,7 @@ make_file_name_valid_for_dest_fs (char *filename, gboolean ret; int i, old_len; - ret = str_replace (filename, FAT_FORBIDDEN_CHARACTERS, '_'); + ret = fat_str_replace (filename, '_'); old_len = strlen (filename); for (i = 0; i < old_len; i++) { |