diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-10-28 21:11:06 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-10-28 21:11:06 +0200 |
commit | d057301b1f28736f094affa17b190244ad56e8d9 (patch) | |
tree | ae20801354321a5ff0d7d23b04d8d6018c57645a /src/fileio.c | |
parent | ef83956e1e67736b4c6b886d897b74f022622a74 (diff) |
patch 8.0.1236: Mac features are confusingv8.0.1236
Problem: Mac features are confusing.
Solution: Make feature names more consistent, add "osxdarwin". Rename
feature flags, cleanup Mac code. (Kazunobu Kuriyama, closes #2178)
Diffstat (limited to 'src/fileio.c')
-rw-r--r-- | src/fileio.c | 38 |
1 files changed, 7 insertions, 31 deletions
diff --git a/src/fileio.c b/src/fileio.c index 82659be07b..87b85cf386 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -68,7 +68,7 @@ static int au_find_group(char_u *name); # define FIO_PUT_CP(x) (((x) & 0xffff) << 16) /* put codepage in top word */ # define FIO_GET_CP(x) (((x)>>16) & 0xffff) /* get codepage from top word */ # endif -# ifdef MACOS_X +# ifdef MACOS_CONVERT # define FIO_MACROMAN 0x20 /* convert MacRoman */ # endif # define FIO_ENDIAN_L 0x80 /* little endian */ @@ -127,7 +127,7 @@ static int make_bom(char_u *buf, char_u *name); # ifdef WIN3264 static int get_win_fio_flags(char_u *ptr); # endif -# ifdef MACOS_X +# ifdef MACOS_CONVERT static int get_mac_fio_flags(char_u *ptr); # endif #endif @@ -1088,7 +1088,7 @@ retry: fio_flags = get_win_fio_flags(fenc); # endif -# ifdef MACOS_X +# ifdef MACOS_CONVERT /* Conversion from Apple MacRoman to latin1 or UTF-8 */ if (fio_flags == 0) fio_flags = get_mac_fio_flags(fenc); @@ -1274,7 +1274,7 @@ retry: else if (fio_flags & FIO_CODEPAGE) size = size / ICONV_MULT; /* also worst case */ # endif -# ifdef MACOS_X +# ifdef MACOS_CONVERT else if (fio_flags & FIO_MACROMAN) size = size / ICONV_MULT; /* also worst case */ # endif @@ -4200,20 +4200,6 @@ buf_write( } } -#ifdef MACOS_CLASSIC /* TODO: Is it need for MACOS_X? (Dany) */ - /* - * Before risking to lose the original file verify if there's - * a resource fork to preserve, and if cannot be done warn - * the users. This happens when overwriting without backups. - */ - if (backup == NULL && overwriting && !append) - if (mch_has_resource_fork(fname)) - { - errmsg = (char_u *)_("E460: The resource fork would be lost (add ! to override)"); - goto restore_backup; - } -#endif - #ifdef VMS vms_remove_version(fname); /* remove version */ #endif @@ -4271,7 +4257,7 @@ buf_write( } # endif -# ifdef MACOS_X +# ifdef MACOS_CONVERT if (converted && wb_flags == 0 && (wb_flags = get_mac_fio_flags(fenc)) != 0) { write_info.bw_conv_buflen = bufsize * 3; @@ -4474,13 +4460,7 @@ restore_backup: } write_info.bw_fd = fd; -#if defined(MACOS_CLASSIC) || defined(WIN3264) - /* TODO: Is it need for MACOS_X? (Dany) */ - /* - * On macintosh copy the original files attributes (i.e. the backup) - * This is done in order to preserve the resource fork and the - * Finder attribute (label, comments, custom icons, file creator) - */ +#if defined(WIN3264) if (backup != NULL && overwriting && !append) { if (backup_copy) @@ -5199,10 +5179,6 @@ nofail: got_int |= prev_got_int; -#ifdef MACOS_CLASSIC /* TODO: Is it need for MACOS_X? (Dany) */ - /* Update machine specific information. */ - mch_post_buffer_write(buf); -#endif return retval; } @@ -5972,7 +5948,7 @@ get_win_fio_flags(char_u *ptr) } #endif -#ifdef MACOS_X +#ifdef MACOS_CONVERT /* * Check "ptr" for a Carbon supported encoding and return the FIO_ flags * needed for the internal conversion to/from utf-8 or latin1. |