diff --git a/eel/eel-vfs-extensions.c b/eel/eel-vfs-extensions.c index d007b5fb0e570289036ec863fd0b2f691d71e1b2..1c4b5b1155446faa13293c9f8cd6bac22e5af04e 100644 --- a/eel/eel-vfs-extensions.c +++ b/eel/eel-vfs-extensions.c @@ -33,8 +33,9 @@ #include "eel-string.h" -#include +#include #include +#include /** * eel_filename_get_extension_offset: @@ -65,6 +66,14 @@ eel_filename_get_extension_offset (const char *filename) return NULL; } + for (size_t i = 1; end[i] != '\0'; i += 1) + { + if (isspace (end[i])) + { + return NULL; + } + } + if (end != start) { if (strcmp (end, ".gz") == 0 || diff --git a/src/nautilus-file-operations.c b/src/nautilus-file-operations.c index c20cf895efa92f8f47fc670d7bbfd65bb69ce574..1faa1ae4142292d663d70be9a75dfbea20619547 100644 --- a/src/nautilus-file-operations.c +++ b/src/nautilus-file-operations.c @@ -9358,7 +9358,8 @@ nautilus_self_check_file_operations (void) EEL_CHECK_STRING_RESULT (get_duplicate_name ("foo foo", 1, -1, FALSE), "foo foo (copy)"); EEL_CHECK_STRING_RESULT (get_duplicate_name ("foo.txt", 1, -1, FALSE), "foo (copy).txt"); EEL_CHECK_STRING_RESULT (get_duplicate_name ("foo foo.txt", 1, -1, FALSE), "foo foo (copy).txt"); - EEL_CHECK_STRING_RESULT (get_duplicate_name ("foo foo.txt txt", 1, -1, FALSE), "foo foo (copy).txt txt"); + EEL_CHECK_STRING_RESULT (get_duplicate_name ("foo foo.txt txt", 1, -1, FALSE), "foo foo.txt txt (copy)"); + EEL_CHECK_STRING_RESULT (get_duplicate_name ("foo foo.txt txt (copy)", 1, -1, FALSE), "foo foo.txt txt (another copy)"); EEL_CHECK_STRING_RESULT (get_duplicate_name ("foo...txt", 1, -1, FALSE), "foo.. (copy).txt"); EEL_CHECK_STRING_RESULT (get_duplicate_name ("foo...", 1, -1, FALSE), "foo... (copy)"); EEL_CHECK_STRING_RESULT (get_duplicate_name ("foo. (copy)", 1, -1, FALSE), "foo. (another copy)");