| To: vim_dev@googlegroups.com |
| Subject: Patch 7.4.906 |
| Fcc: outbox |
| From: Bram Moolenaar <Bram@moolenaar.net> |
| Mime-Version: 1.0 |
| Content-Type: text/plain; charset=UTF-8 |
| Content-Transfer-Encoding: 8bit |
| |
| |
| Patch 7.4.906 |
| Problem: On MS-Windows the viminfo file is (always) given the hidden |
| attribute. (raulnac) |
| Solution: Check the hidden attribute in a different way. (Ken Takata) |
| Files: src/ex_cmds.c, src/os_win32.c, src/os_win32.pro |
| |
| |
| |
| |
| |
| *** 1795,1801 **** |
| struct stat st_old; /* mch_stat() of existing viminfo file */ |
| #endif |
| #ifdef WIN3264 |
| ! long perm = -1; |
| #endif |
| |
| if (no_viminfo()) |
| --- 1795,1801 ---- |
| struct stat st_old; /* mch_stat() of existing viminfo file */ |
| #endif |
| #ifdef WIN3264 |
| ! int hidden = FALSE; |
| #endif |
| |
| if (no_viminfo()) |
| |
| *** 1858,1864 **** |
| #endif |
| #ifdef WIN3264 |
| /* Get the file attributes of the existing viminfo file. */ |
| ! perm = mch_getperm(fname); |
| #endif |
| |
| /* |
| --- 1858,1864 ---- |
| #endif |
| #ifdef WIN3264 |
| /* Get the file attributes of the existing viminfo file. */ |
| ! hidden = mch_ishidden(fname); |
| #endif |
| |
| /* |
| |
| *** 2033,2039 **** |
| |
| #ifdef WIN3264 |
| /* If the viminfo file was hidden then also hide the new file. */ |
| ! if (perm > 0 && (perm & FILE_ATTRIBUTE_HIDDEN)) |
| mch_hide(fname); |
| #endif |
| } |
| --- 2033,2039 ---- |
| |
| #ifdef WIN3264 |
| /* If the viminfo file was hidden then also hide the new file. */ |
| ! if (hidden) |
| mch_hide(fname); |
| #endif |
| } |
| |
| |
| |
| *** 3098,3103 **** |
| --- 3098,3117 ---- |
| } |
| |
| /* |
| + * Return TRUE if file "name" exists and is hidden. |
| + */ |
| + int |
| + mch_ishidden(char_u *name) |
| + { |
| + int f = win32_getattrs(name); |
| + |
| + if (f == -1) |
| + return FALSE; /* file does not exist at all */ |
| + |
| + return (f & FILE_ATTRIBUTE_HIDDEN) != 0; |
| + } |
| + |
| + /* |
| * return TRUE if "name" is a directory |
| * return FALSE if "name" is not a directory or upon error |
| */ |
| |
| |
| |
| *** 743,744 **** |
| --- 743,746 ---- |
| { /* Add new patch number below this line */ |
| + /**/ |
| + 906, |
| /**/ |
| |
| -- |
| hundred-and-one symptoms of being an internet addict: |
| 81. At social functions you introduce your husband as "my domain server." |
| |
| /// 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 /// |