[nautilus/wip/corey/samba: 9/10] file-operations: Use g_strcmp0 instead of strcmp




commit 835839c6121e3948d2335b0fbb3af5bc5f5f567f
Author: Corey Berla <corey berla me>
Date:   Sat Sep 17 18:57:49 2022 -0700

    file-operations: Use g_strcmp0 instead of strcmp
    
    In the next commit we will compare by dest file type
    and the GFile scheme, so this will make that cleaner

 src/nautilus-file-operations.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/src/nautilus-file-operations.c b/src/nautilus-file-operations.c
index aa8bd29f3..becd3efec 100644
--- a/src/nautilus-file-operations.c
+++ b/src/nautilus-file-operations.c
@@ -4306,18 +4306,18 @@ static gboolean
 make_file_name_valid_for_dest_fs (char       *filename,
                                   const char *dest_fs_type)
 {
-    if (dest_fs_type != NULL && filename != NULL)
+    if (filename != NULL)
     {
-        if (!strcmp (dest_fs_type, "fat") ||
-            !strcmp (dest_fs_type, "vfat") ||
+        if (g_strcmp0 (dest_fs_type, "fat") == 0 ||
+            g_strcmp0 (dest_fs_type, "vfat") == 0 ||
             /* The fuseblk filesystem type could be of any type
              * in theory, but in practice is usually NTFS or exFAT.
              * This assumption is a pragmatic way to solve
              * https://gitlab.gnome.org/GNOME/nautilus/-/issues/1343 */
-            !strcmp (dest_fs_type, "fuse") ||
-            !strcmp (dest_fs_type, "ntfs") ||
-            !strcmp (dest_fs_type, "msdos") ||
-            !strcmp (dest_fs_type, "msdosfs"))
+            g_strcmp0 (dest_fs_type, "fuse") == 0 ||
+            g_strcmp0 (dest_fs_type, "ntfs") == 0 ||
+            g_strcmp0 (dest_fs_type, "msdos") == 0 ||
+            g_strcmp0 (dest_fs_type, "msdosfs") == 0)
         {
             gboolean ret;
             int i, old_len;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]