keyfile: ignore temp files ending with ~
authorDan Williams <dcbw@redhat.com>
Mon, 14 Mar 2011 04:59:09 +0000 (23:59 -0500)
committerDan Williams <dcbw@redhat.com>
Mon, 14 Mar 2011 04:59:09 +0000 (23:59 -0500)
src/settings/plugins/keyfile/utils.c

index c7cdc63..7b93a24 100644 (file)
@@ -88,7 +88,8 @@ nm_keyfile_plugin_utils_should_ignore_file (const char *filename)
        /* Ignore files with certain patterns */
        if (   (check_prefix (base, ".") && check_suffix (base, SWP_TAG))   /* vim temporary files: .filename.swp */
            || (check_prefix (base, ".") && check_suffix (base, SWPX_TAG))  /* vim temporary files: .filename.swpx */
-           || check_mkstemp_suffix (base))                                 /* temporary files created by mkstemp() */
+           || check_mkstemp_suffix (base)                                  /* temporary files created by mkstemp() */
+           || base[strlen (base) - 1] == '~')
                ignore = TRUE;
 
        g_free (base);