To: vim_dev@googlegroups.com Subject: Patch 7.4.1116 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 7.4.1116 Problem: delete(x, 'rf') does not delete files starting with a dot. Solution: Also delete files starting with a dot. Files: src/misc1.c, src/fileio.c, src/vim.h *** ../vim-7.4.1115/src/misc1.c 2016-01-15 15:16:58.336609048 +0100 --- src/misc1.c 2016-01-17 16:45:32.955129298 +0100 *************** *** 10013,10019 **** if (p[0] == '*' && p[1] == '*') starstar = TRUE; ! starts_with_dot = (*s == '.'); pat = file_pat_to_reg_pat(s, e, NULL, FALSE); if (pat == NULL) { --- 10013,10019 ---- if (p[0] == '*' && p[1] == '*') starstar = TRUE; ! starts_with_dot = *s == '.' || (flags & EW_DODOT); pat = file_pat_to_reg_pat(s, e, NULL, FALSE); if (pat == NULL) { *************** *** 10096,10102 **** #endif /* Ignore entries starting with a dot, unless when asked for. Accept * all entries found with "matchname". */ ! if ((p[0] != '.' || starts_with_dot) && (matchname == NULL || (regmatch.regprog != NULL && vim_regexec(®match, p, (colnr_T)0)) --- 10096,10103 ---- #endif /* Ignore entries starting with a dot, unless when asked for. Accept * all entries found with "matchname". */ ! if ((p[0] != '.' || (starts_with_dot ! && p[1] != NUL && (p[1] != '.' || p[2] != NUL))) && (matchname == NULL || (regmatch.regprog != NULL && vim_regexec(®match, p, (colnr_T)0)) *************** *** 10325,10331 **** starstar = TRUE; /* convert the file pattern to a regexp pattern */ ! starts_with_dot = (*s == '.'); pat = file_pat_to_reg_pat(s, e, NULL, FALSE); if (pat == NULL) { --- 10326,10332 ---- starstar = TRUE; /* convert the file pattern to a regexp pattern */ ! starts_with_dot = *s == '.' || (flags & EW_DODOT); pat = file_pat_to_reg_pat(s, e, NULL, FALSE); if (pat == NULL) { *************** *** 10374,10380 **** dp = readdir(dirp); if (dp == NULL) break; ! if ((dp->d_name[0] != '.' || starts_with_dot) && ((regmatch.regprog != NULL && vim_regexec(®match, (char_u *)dp->d_name, (colnr_T)0)) || ((flags & EW_NOTWILD) --- 10375,10383 ---- dp = readdir(dirp); if (dp == NULL) break; ! if ((dp->d_name[0] != '.' || (starts_with_dot ! && dp->d_name[1] != NUL ! && (dp->d_name[1] != '.' || dp->d_name[2] != NUL))) && ((regmatch.regprog != NULL && vim_regexec(®match, (char_u *)dp->d_name, (colnr_T)0)) || ((flags & EW_NOTWILD) *** ../vim-7.4.1115/src/fileio.c 2016-01-17 15:56:29.362605265 +0100 --- src/fileio.c 2016-01-17 16:29:41.753299747 +0100 *************** *** 7313,7319 **** if (exp == NULL) return -1; if (gen_expand_wildcards(1, &exp, &file_count, &files, ! EW_DIR|EW_FILE|EW_SILENT) == OK) { for (i = 0; i < file_count; ++i) if (delete_recursive(files[i]) != 0) --- 7313,7319 ---- if (exp == NULL) return -1; if (gen_expand_wildcards(1, &exp, &file_count, &files, ! EW_DIR|EW_FILE|EW_SILENT|EW_ALLLINKS|EW_DODOT) == OK) { for (i = 0; i < file_count; ++i) if (delete_recursive(files[i]) != 0) *** ../vim-7.4.1115/src/vim.h 2016-01-15 21:23:15.658977959 +0100 --- src/vim.h 2016-01-17 16:28:05.126332735 +0100 *************** *** 835,840 **** --- 835,841 ---- #define EW_ALLLINKS 0x1000 /* also links not pointing to existing file */ #define EW_SHELLCMD 0x2000 /* called from expand_shellcmd(), don't check * if executable is in $PATH */ + #define EW_DODOT 0x4000 /* also files starting with a dot */ /* Flags for find_file_*() functions. */ #define FINDFILE_FILE 0 /* only files */ *** ../vim-7.4.1115/src/version.c 2016-01-17 16:15:27.806426027 +0100 --- src/version.c 2016-01-17 16:29:53.569173425 +0100 *************** *** 743,744 **** --- 743,746 ---- { /* Add new patch number below this line */ + /**/ + 1116, /**/ -- You can test a person's importance in the organization by asking how much RAM his computer has. Anybody who knows the answer to that question is not a decision-maker. (Scott Adams - The Dilbert principle) /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///