Patch 8.2.3960

31 views
Skip to first unread message

Bram Moolenaar

unread,
Dec 31, 2021, 3:01:49 PM12/31/21
to vim...@googlegroups.com

Patch 8.2.3960
Problem: Error messages are spread out.
Solution: Move more errors to errors.h.
Files: src/errors.h, src/alloc.c, src/arglist.c, src/autocmd.c,
src/blob.c, src/blowfish.c, src/buffer.c, src/bufwrite.c


*** ../vim-8.2.3959/src/errors.h 2021-12-31 18:49:39.141303437 +0000
--- src/errors.h 2021-12-31 19:56:52.194610069 +0000
***************
*** 495,504 ****
--- 495,516 ----
INIT(= N_("E229: Cannot start the GUI"));


+ EXTERN char e_window_layout_changed_unexpectedly[]
+ INIT(= N_("E249: window layout changed unexpectedly"));
#if defined(FEAT_GUI) || defined(FEAT_TERMGUICOLORS)
EXTERN char e_cannot_allocate_color_str[]
INIT(= N_("E254: Cannot allocate color %s"));
#endif
+
+ EXTERN char e_internal_error_lalloc_zero[]
+ INIT(= N_("E341: Internal error: lalloc(0, )"));
+ EXTERN char e_out_of_memory_allocating_nr_bytes[]
+ INIT(= N_("E342: Out of memory! (allocating %lu bytes)"));
+ EXTERN char e_no_such_group_str[]
+ INIT(= N_("E367: No such group: \"%s\""));
+ EXTERN char e_cannot_write_buftype_option_is_set[]
+ INIT(= N_("E382: Cannot write, 'buftype' option is set"));
+
EXTERN char e_ambiguous_use_of_user_defined_command[]
INIT(= N_("E464: Ambiguous use of user-defined command"));
EXTERN char e_invalid_command[]
***************
*** 506,513 ****
--- 518,579 ----
#ifdef FEAT_EVAL
EXTERN char e_invalid_command_str[]
INIT(= N_("E476: Invalid command: %s"));
+
+ // E502
+ EXTERN char e_is_a_directory[]
+ INIT(= N_("is a directory"));
+ // E503
+ EXTERN char e_is_not_file_or_writable_device[]
+ INIT(= N_("is not a file or writable device"));
+
+ // E504
+ EXTERN char e_is_read_only_cannot_override_W_in_cpoptions[]
+ INIT(= N_("is read-only (cannot override: \"W\" in 'cpoptions')"));
+ // E505
+ EXTERN char e_is_read_only_add_bang_to_override[]
+ INIT(= N_("is read-only (add ! to override)"));
+ EXTERN char e_canot_write_to_backup_file_add_bang_to_override[]
+ INIT(= N_("E506: Can't write to backup file (add ! to override)"));
+ EXTERN char e_close_error_for_backup_file_add_bang_to_write_anyway[]
+ INIT(= N_("E507: Close error for backup file (add ! to write anyway)"));
+ EXTERN char e_cant_read_file_for_backup_add_bang_to_write_anyway[]
+ INIT(= N_("E508: Can't read file for backup (add ! to write anyway)"));
+ EXTERN char e_cannot_create_backup_file_add_bang_to_write_anyway[]
+ INIT(= N_("E509: Cannot create backup file (add ! to override)"));
+ EXTERN char e_cant_make_backup_file_add_bang_to_write_anyway[]
+ INIT(= N_("E510: Can't make backup file (add ! to write anyway)"));
+ EXTERN char e_close_failed[]
+ INIT(= N_("E512: Close failed"));
+ EXTERN char e_write_error_conversion_failed_make_fenc_empty_to_override[]
+ INIT(= N_("E513: write error, conversion failed (make 'fenc' empty to override)"));
+ EXTERN char e_write_error_conversion_failed_in_line_nr_make_fenc_empty_to_override[]
+ INIT(= N_("E513: write error, conversion failed in line %ld (make 'fenc' empty to override)"));
+ EXTERN char e_write_error_file_system_full[]
+ INIT(= N_("E514: write error (file system full?)"));
+ EXTERN char e_no_buffers_were_unloaded[]
+ INIT(= N_("E515: No buffers were unloaded"));
+ EXTERN char e_no_buffers_were_deleted[]
+ INIT(= N_("E516: No buffers were deleted"));
+ EXTERN char e_no_buffers_were_wiped_out[]
+ INIT(= N_("E517: No buffers were wiped out"));
+
+ EXTERN char e_no_argument_to_delete[]
+ INIT(= N_("E610: No argument to delete"));
+ #ifdef FEAT_NETBEANS_INTG
+ // E656
+ EXTERN char e_netbeans_disallows_writes_of_unmodified_buffers[]
+ INIT(= N_("NetBeans disallows writes of unmodified buffers"));
+ // E657
+ EXTERN char e_partial_writes_disallowed_for_netbeans_buffers[]
+ INIT(= N_("Partial writes disallowed for NetBeans buffers"));
+ #endif
+ EXTERN char e_no_matching_autocommands_for_acwrite_buffer[]
+ INIT(= N_("E676: No matching autocommands for acwrite buffer"));
+ EXTERN char e_buffer_nr_invalid_buffer_number[]
+ INIT(= N_("E680: <buffer=%d>: invalid buffer number"));
EXTERN char e_cannot_index_a_funcref[]
INIT(= N_("E695: Cannot index a Funcref"));
+
EXTERN char e_list_value_has_more_items_than_targets[]
INIT(= N_("E710: List value has more items than targets"));
EXTERN char e_list_value_does_not_have_enough_items[]
***************
*** 528,552 ****
--- 594,652 ----
INIT(= N_("E794: Cannot set variable in the sandbox: \"%s\""));
EXTERN char e_cannot_delete_variable[]
INIT(= N_("E795: Cannot delete variable"));
+ // E796
+ EXTERN char e_writing_to_device_disabled_with_opendevice_option[]
+ INIT(= N_("writing to device disabled with 'opendevice' option"));
EXTERN char e_cannot_delete_variable_str[]
INIT(= N_("E795: Cannot delete variable %s"));
#endif
+
+ EXTERN char e_blowfish_big_little_endian_use_wrong[]
+ INIT(= N_("E817: Blowfish big/little endian use wrong"));
+ EXTERN char e_sha256_test_failed[]
+ INIT(= N_("E818: sha256 test failed"));
+ EXTERN char e_blowfish_test_failed[]
+ INIT(= N_("E819: Blowfish test failed"));
+ EXTERN char e_sizeof_uint32_isnot_four[]
+ INIT(= N_("E820: sizeof(uint32_t) != 4"));
+ EXTERN char e_bf_key_init_called_with_empty_password[]
+ INIT(= N_("E831: bf_key_init() called with empty password"));
EXTERN char e_conflicts_with_value_of_listchars[]
INIT(= N_("E834: Conflicts with value of 'listchars'"));
EXTERN char e_conflicts_with_value_of_fillchars[]
INIT(= N_("E835: Conflicts with value of 'fillchars'"));
+ EXTERN char e_autocommands_caused_command_to_abort[]
+ INIT(= N_("E855: Autocommands caused command to abort"));
#ifdef FEAT_EVAL
EXTERN char e_assert_fails_second_arg[]
INIT(= N_("E856: \"assert_fails()\" second argument must be a string or a list with one or two strings"));
+
EXTERN char e_using_invalid_value_as_string_str[]
INIT(= N_("E908: using an invalid value as a String: %s"));
EXTERN char e_cannot_index_special_variable[]
INIT(= N_("E909: Cannot index a special variable"));
#endif
+ EXTERN char e_buffer_cannot_be_registered[]
+ INIT(= N_("E931: Buffer cannot be registered"));
+ EXTERN char e_cannot_delete_current_group[]
+ INIT(= N_("E936: Cannot delete the current group"));
+ EXTERN char e_attempt_to_delete_buffer_that_is_in_use_str[]
+ INIT(= N_("E937: Attempt to delete a buffer that is in use: %s"));
+ #ifdef FEAT_TERMINAL
+ EXTERN char e_job_still_running[]
+ INIT(= N_("E948: Job still running"));
+ EXTERN char e_job_still_running_add_bang_to_end_the_job[]
+ INIT(= N_("E948: Job still running (add ! to end the job)"));
+ EXTERN char e_file_changed_while_writing[]
+ INIT(= N_("E949: File changed while writing"));
+ #endif
EXTERN char_u e_invalid_column_number_nr[]
INIT(= N_("E964: Invalid column number: %ld"));
EXTERN char_u e_invalid_line_number_nr[]
INIT(= N_("E966: Invalid line number: %ld"));
+ EXTERN char e_blob_value_does_not_have_right_number_of_bytes[]
+ INIT(= N_("E972: Blob value does not have the right number of bytes"));
+
EXTERN char e_command_not_supported_in_vim9_script_missing_var_str[]
INIT(= N_("E1100: Command not supported in Vim9 script (missing :var?): %s"));
#ifdef FEAT_EVAL
*** ../vim-8.2.3959/src/alloc.c 2021-12-27 17:21:38.000449144 +0000
--- src/alloc.c 2021-12-31 19:08:44.459686822 +0000
***************
*** 224,230 ****
{
// Don't hide this message
emsg_silent = 0;
! iemsg(_("E341: Internal error: lalloc(0, )"));
return NULL;
}

--- 224,230 ----
{
// Don't hide this message
emsg_silent = 0;
! iemsg(_(e_internal_error_lalloc_zero));
return NULL;
}

***************
*** 339,345 ****
// message fails, e.g. when setting v:errmsg.
did_outofmem_msg = TRUE;

! semsg(_("E342: Out of memory! (allocating %lu bytes)"), (long_u)size);

if (starting == NO_SCREEN)
// Not even finished with initializations and already out of
--- 339,345 ----
// message fails, e.g. when setting v:errmsg.
did_outofmem_msg = TRUE;

! semsg(_(e_out_of_memory_allocating_nr_bytes), (long_u)size);

if (starting == NO_SCREEN)
// Not even finished with initializations and already out of
*** ../vim-8.2.3959/src/arglist.c 2021-12-31 17:25:44.040304835 +0000
--- src/arglist.c 2021-12-31 19:11:07.055476587 +0000
***************
*** 839,845 ****
{
if (curwin->w_arg_idx >= ARGCOUNT)
{
! emsg(_("E610: No argument to delete"));
return;
}
eap->line1 = eap->line2 = curwin->w_arg_idx + 1;
--- 839,845 ----
{
if (curwin->w_arg_idx >= ARGCOUNT)
{
! emsg(_(e_no_argument_to_delete));
return;
}
eap->line1 = eap->line2 = curwin->w_arg_idx + 1;
***************
*** 1129,1135 ****
else if (wpnext->w_frame->fr_parent
!= curwin->w_frame->fr_parent)
{
! emsg(_("E249: window layout changed unexpectedly"));
i = count;
break;
}
--- 1129,1135 ----
else if (wpnext->w_frame->fr_parent
!= curwin->w_frame->fr_parent)
{
! emsg(_(e_window_layout_changed_unexpectedly));
i = count;
break;
}
*** ../vim-8.2.3959/src/autocmd.c 2021-12-31 18:49:39.141303437 +0000
--- src/autocmd.c 2021-12-31 19:13:32.011262316 +0000
***************
*** 515,523 ****

i = au_find_group(name);
if (i == AUGROUP_ERROR) // the group doesn't exist
! semsg(_("E367: No such group: \"%s\""), name);
else if (i == current_augroup)
! emsg(_("E936: Cannot delete the current group"));
else
{
event_T event;
--- 515,523 ----

i = au_find_group(name);
if (i == AUGROUP_ERROR) // the group doesn't exist
! semsg(_(e_no_such_group_str), name);
else if (i == current_augroup)
! emsg(_(e_cannot_delete_current_group));
else
{
event_T event;
***************
*** 1205,1212 ****
if (is_buflocal && (buflocal_nr == 0
|| buflist_findnr(buflocal_nr) == NULL))
{
! semsg(_("E680: <buffer=%d>: invalid buffer number "),
! buflocal_nr);
return FAIL;
}

--- 1205,1211 ----
if (is_buflocal && (buflocal_nr == 0
|| buflist_findnr(buflocal_nr) == NULL))
{
! semsg(_(e_buffer_nr_invalid_buffer_number), buflocal_nr);
return FAIL;
}

*** ../vim-8.2.3959/src/blob.c 2021-12-22 18:19:22.602372473 +0000
--- src/blob.c 2021-12-31 19:16:57.714957342 +0000
***************
*** 399,405 ****

if (n2 - n1 + 1 != blob_len(src->vval.v_blob))
{
! emsg(_("E972: Blob value does not have the right number of bytes"));
return FAIL;
}

--- 399,405 ----

if (n2 - n1 + 1 != blob_len(src->vval.v_blob))
{
! emsg(_(e_blob_value_does_not_have_right_number_of_bytes));
return FAIL;
}

*** ../vim-8.2.3959/src/blowfish.c 2021-12-27 17:21:38.000449144 +0000
--- src/blowfish.c 2021-12-31 19:22:00.790457858 +0000
***************
*** 416,422 ****
keylen = (int)STRLEN(key) / 2;
if (keylen == 0)
{
! iemsg(_("E831: bf_key_init() called with empty password"));
return;
}
for (i = 0; i < keylen; i++)
--- 416,422 ----
keylen = (int)STRLEN(key) / 2;
if (keylen == 0)
{
! iemsg(_(e_bf_key_init_called_with_empty_password));
return;
}
for (i = 0; i < keylen; i++)
***************
*** 519,525 ****
// warning.
if (ui != 0xffffffffUL || ui + 1 != 0) {
err++;
! emsg(_("E820: sizeof(uint32_t) != 4"));
}

if (!bf_check_tables(pax_init, sbx_init, 0x6ffa520a))
--- 519,525 ----
// warning.
if (ui != 0xffffffffUL || ui + 1 != 0) {
err++;
! emsg(_(e_sizeof_uint32_isnot_four));
}

if (!bf_check_tables(pax_init, sbx_init, 0x6ffa520a))
***************
*** 540,546 ****
if (memcmp(bk.uc, bf_test_data[i].cryptxt, 8) != 0)
{
if (err == 0 && memcmp(bk.uc, bf_test_data[i].badcryptxt, 8) == 0)
! emsg(_("E817: Blowfish big/little endian use wrong"));
err++;
}
}
--- 540,546 ----
if (memcmp(bk.uc, bf_test_data[i].cryptxt, 8) != 0)
{
if (err == 0 && memcmp(bk.uc, bf_test_data[i].badcryptxt, 8) == 0)
! emsg(_(e_blowfish_big_little_endian_use_wrong));
err++;
}
}
***************
*** 672,683 ****
{
if (sha256_self_test() == FAIL)
{
! emsg(_("E818: sha256 test failed"));
return FAIL;
}
if (bf_self_test() == FAIL)
{
! emsg(_("E819: Blowfish test failed"));
return FAIL;
}
return OK;
--- 672,683 ----
{
if (sha256_self_test() == FAIL)
{
! emsg(_(e_sha256_test_failed));
return FAIL;
}
if (bf_self_test() == FAIL)
{
! emsg(_(e_blowfish_test_failed));
return FAIL;
}
return OK;
*** ../vim-8.2.3959/src/buffer.c 2021-12-27 17:21:38.000449144 +0000
--- src/buffer.c 2021-12-31 19:31:04.085551176 +0000
***************
*** 63,69 ****
static char *msg_loclist = N_("[Location List]");
static char *msg_qflist = N_("[Quickfix List]");
#endif
- static char *e_auabort = N_("E855: Autocommands caused command to abort");

// Number of times free_buffer() was called.
static int buf_free_count = 0;
--- 63,68 ----
***************
*** 427,433 ****
{
sprintf((char *)buf->b_key, "%x", buf->b_fnum);
if (hash_add(&buf_hashtab, buf->b_key) == FAIL)
! emsg(_("E931: Buffer cannot be registered"));
}

static void
--- 426,432 ----
{
sprintf((char *)buf->b_key, "%x", buf->b_fnum);
if (hash_add(&buf_hashtab, buf->b_key) == FAIL)
! emsg(_(e_buffer_cannot_be_registered));
}

static void
***************
*** 461,468 ****
}
}
if (!can_unload)
! semsg(_("E937: Attempt to delete a buffer that is in use: %s"),
! buf->b_fname);
return can_unload;
}

--- 460,466 ----
}
}
if (!can_unload)
! semsg(_(e_attempt_to_delete_buffer_that_is_in_use_str), buf->b_fname);
return can_unload;
}

***************
*** 594,600 ****
{
// Autocommands deleted the buffer.
aucmd_abort:
! emsg(_(e_auabort));
return FALSE;
}
--buf->b_locked;
--- 592,598 ----
{
// Autocommands deleted the buffer.
aucmd_abort:
! emsg(_(e_autocommands_caused_command_to_abort));
return FALSE;
}
--buf->b_locked;
***************
*** 1660,1670 ****
if (deleted == 0)
{
if (command == DOBUF_UNLOAD)
! STRCPY(IObuff, _("E515: No buffers were unloaded"));
else if (command == DOBUF_DEL)
! STRCPY(IObuff, _("E516: No buffers were deleted"));
else
! STRCPY(IObuff, _("E517: No buffers were wiped out"));
errormsg = (char *)IObuff;
}
else if (deleted >= p_report)
--- 1658,1668 ----
if (deleted == 0)
{
if (command == DOBUF_UNLOAD)
! STRCPY(IObuff, _(e_no_buffers_were_unloaded));
else if (command == DOBUF_DEL)
! STRCPY(IObuff, _(e_no_buffers_were_deleted));
else
! STRCPY(IObuff, _(e_no_buffers_were_wiped_out));
errormsg = (char *)IObuff;
}
else if (deleted >= p_report)
***************
*** 1905,1911 ****
{
#ifdef FEAT_TERMINAL
if (term_job_running(curbuf->b_term))
! emsg(_("E948: Job still running (add ! to end the job)"));
else
#endif
emsg(_(e_no_write_since_last_change_add_bang_to_override));
--- 1903,1909 ----
{
#ifdef FEAT_TERMINAL
if (term_job_running(curbuf->b_term))
! emsg(_(e_job_still_running_add_bang_to_end_the_job));
else
#endif
emsg(_(e_no_write_since_last_change_add_bang_to_override));
***************
*** 1916,1922 ****
{
#ifdef FEAT_TERMINAL
if (term_job_running(buf->b_term))
! emsg(_("E948: Job still running"));
else
#endif
emsg(_(e_no_write_since_last_change));
--- 1914,1920 ----
{
#ifdef FEAT_TERMINAL
if (term_job_running(buf->b_term))
! emsg(_(e_job_still_running));
else
#endif
emsg(_(e_no_write_since_last_change));
***************
*** 5661,5667 ****
{
if (bt_dontwrite(buf))
{
! emsg(_("E382: Cannot write, 'buftype' option is set"));
return TRUE;
}
return FALSE;
--- 5659,5665 ----
{
if (bt_dontwrite(buf))
{
! emsg(_(e_cannot_write_buftype_option_is_set));
return TRUE;
}
return FALSE;
*** ../vim-8.2.3959/src/bufwrite.c 2021-12-31 18:49:39.141303437 +0000
--- src/bufwrite.c 2021-12-31 19:57:03.234569031 +0000
***************
*** 667,673 ****
int prev_got_int = got_int;
int checking_conversion;
int file_readonly = FALSE; // overwritten file is read-only
- static char *err_readonly = "is read-only (cannot override: \"W\" in 'cpoptions')";
#if defined(UNIX) // XXX fix me sometime?
int made_writable = FALSE; // 'w' bit has been set
#endif
--- 667,672 ----
***************
*** 897,903 ****
--no_wait_return;
msg_scroll = msg_save;
if (nofile_err)
! emsg(_("E676: No matching autocommands for acwrite buffer"));

if (nofile_err
#ifdef FEAT_EVAL
--- 896,902 ----
--no_wait_return;
msg_scroll = msg_save;
if (nofile_err)
! emsg(_(e_no_matching_autocommands_for_acwrite_buffer));

if (nofile_err
#ifdef FEAT_EVAL
***************
*** 995,1001 ****
else
{
errnum = (char_u *)"E656: ";
! errmsg = (char_u *)_("NetBeans disallows writes of unmodified buffers");
buffer = NULL;
goto fail;
}
--- 994,1000 ----
else
{
errnum = (char_u *)"E656: ";
! errmsg = (char_u *)_(e_netbeans_disallows_writes_of_unmodified_buffers);
buffer = NULL;
goto fail;
}
***************
*** 1003,1009 ****
else
{
errnum = (char_u *)"E657: ";
! errmsg = (char_u *)_("Partial writes disallowed for NetBeans buffers");
buffer = NULL;
goto fail;
}
--- 1002,1008 ----
else
{
errnum = (char_u *)"E657: ";
! errmsg = (char_u *)_(e_partial_writes_disallowed_for_netbeans_buffers);
buffer = NULL;
goto fail;
}
***************
*** 1050,1062 ****
if (S_ISDIR(st_old.st_mode))
{
errnum = (char_u *)"E502: ";
! errmsg = (char_u *)_("is a directory");
goto fail;
}
if (mch_nodetype(fname) != NODE_WRITABLE)
{
errnum = (char_u *)"E503: ";
! errmsg = (char_u *)_("is not a file or writable device");
goto fail;
}
// It's a device of some kind (or a fifo) which we can write to
--- 1049,1061 ----
if (S_ISDIR(st_old.st_mode))
{
errnum = (char_u *)"E502: ";
! errmsg = (char_u *)_(e_is_a_directory);
goto fail;
}
if (mch_nodetype(fname) != NODE_WRITABLE)
{
errnum = (char_u *)"E503: ";
! errmsg = (char_u *)_(e_is_not_file_or_writable_device);
goto fail;
}
// It's a device of some kind (or a fifo) which we can write to
***************
*** 1072,1078 ****
if (c == NODE_OTHER)
{
errnum = (char_u *)"E503: ";
! errmsg = (char_u *)_("is not a file or writable device");
goto fail;
}
if (c == NODE_WRITABLE)
--- 1071,1077 ----
if (c == NODE_OTHER)
{
errnum = (char_u *)"E503: ";
! errmsg = (char_u *)_(e_is_not_file_or_writable_device);
goto fail;
}
if (c == NODE_WRITABLE)
***************
*** 1083,1089 ****
if (!p_odev)
{
errnum = (char_u *)"E796: ";
! errmsg = (char_u *)_("writing to device disabled with 'opendevice' option");
goto fail;
}
# endif
--- 1082,1088 ----
if (!p_odev)
{
errnum = (char_u *)"E796: ";
! errmsg = (char_u *)_(e_writing_to_device_disabled_with_opendevice_option);
goto fail;
}
# endif
***************
*** 1099,1105 ****
else if (mch_isdir(fname))
{
errnum = (char_u *)"E502: ";
! errmsg = (char_u *)_("is a directory");
goto fail;
}
if (overwriting)
--- 1098,1104 ----
else if (mch_isdir(fname))
{
errnum = (char_u *)"E502: ";
! errmsg = (char_u *)_(e_is_a_directory);
goto fail;
}
if (overwriting)
***************
*** 1118,1129 ****
if (vim_strchr(p_cpo, CPO_FWRITE) != NULL)
{
errnum = (char_u *)"E504: ";
! errmsg = (char_u *)_(err_readonly);
}
else
{
errnum = (char_u *)"E505: ";
! errmsg = (char_u *)_("is read-only (add ! to override)");
}
goto fail;
}
--- 1117,1128 ----
if (vim_strchr(p_cpo, CPO_FWRITE) != NULL)
{
errnum = (char_u *)"E504: ";
! errmsg = (char_u *)_(e_is_read_only_cannot_override_W_in_cpoptions);
}
else
{
errnum = (char_u *)"E505: ";
! errmsg = (char_u *)_(e_is_read_only_add_bang_to_override);
}
goto fail;
}
***************
*** 1477,1483 ****
{
if (buf_write_bytes(&write_info) == FAIL)
{
! errmsg = (char_u *)_("E506: Can't write to backup file (add ! to override)");
break;
}
ui_breakcheck();
--- 1476,1482 ----
{
if (buf_write_bytes(&write_info) == FAIL)
{
! errmsg = (char_u *)_(e_canot_write_to_backup_file_add_bang_to_override);
break;
}
ui_breakcheck();
***************
*** 1489,1497 ****
}

if (close(bfd) < 0 && errmsg == NULL)
! errmsg = (char_u *)_("E507: Close error for backup file (add ! to override)");
if (write_info.bw_len < 0)
! errmsg = (char_u *)_("E508: Can't read file for backup (add ! to override)");
#ifdef UNIX
set_file_time(backup, st_old.st_atime, st_old.st_mtime);
#endif
--- 1488,1496 ----
}

if (close(bfd) < 0 && errmsg == NULL)
! errmsg = (char_u *)_(e_close_error_for_backup_file_add_bang_to_write_anyway);
if (write_info.bw_len < 0)
! errmsg = (char_u *)_(e_cant_read_file_for_backup_add_bang_to_write_anyway);
#ifdef UNIX
set_file_time(backup, st_old.st_atime, st_old.st_mtime);
#endif
***************
*** 1513,1519 ****
vim_free(copybuf);

if (backup == NULL && errmsg == NULL)
! errmsg = (char_u *)_("E509: Cannot create backup file (add ! to override)");
// ignore errors when forceit is TRUE
if ((some_error || errmsg != NULL) && !forceit)
{
--- 1512,1518 ----
vim_free(copybuf);

if (backup == NULL && errmsg == NULL)
! errmsg = (char_u *)_(e_cannot_create_backup_file_add_bang_to_write_anyway);
// ignore errors when forceit is TRUE
if ((some_error || errmsg != NULL) && !forceit)
{
***************
*** 1536,1542 ****
if (file_readonly && vim_strchr(p_cpo, CPO_FWRITE) != NULL)
{
errnum = (char_u *)"E504: ";
! errmsg = (char_u *)_(err_readonly);
goto fail;
}

--- 1535,1541 ----
if (file_readonly && vim_strchr(p_cpo, CPO_FWRITE) != NULL)
{
errnum = (char_u *)"E504: ";
! errmsg = (char_u *)_(e_is_read_only_cannot_override_W_in_cpoptions);
goto fail;
}

***************
*** 1608,1614 ****
}
if (backup == NULL && !forceit)
{
! errmsg = (char_u *)_("E510: Can't make backup file (add ! to override)");
goto fail;
}
}
--- 1607,1613 ----
}
if (backup == NULL && !forceit)
{
! errmsg = (char_u *)_(e_cant_make_backup_file_add_bang_to_write_anyway);
goto fail;
}
}
***************
*** 1903,1909 ****
&& st.st_ino != st_old.st_ino)
{
close(fd);
! errmsg = (char_u *)_("E949: File changed while writing");
goto fail;
}
}
--- 1902,1908 ----
&& st.st_ino != st_old.st_ino)
{
close(fd);
! errmsg = (char_u *)_(e_file_changed_while_writing);
goto fail;
}
}
***************
*** 2229,2235 ****
#endif
if (close(fd) != 0)
{
! errmsg = (char_u *)_("E512: Close failed");
end = 0;
}

--- 2228,2234 ----
#endif
if (close(fd) != 0)
{
! errmsg = (char_u *)_(e_close_failed);
end = 0;
}

***************
*** 2286,2304 ****
if (write_info.bw_conv_error)
{
if (write_info.bw_conv_error_lnum == 0)
! errmsg = (char_u *)_("E513: write error, conversion failed (make 'fenc' empty to override)");
else
{
errmsg_allocated = TRUE;
errmsg = alloc(300);
! vim_snprintf((char *)errmsg, 300, _("E513: write error, conversion failed in line %ld (make 'fenc' empty to override)"),
(long)write_info.bw_conv_error_lnum);
}
}
else if (got_int)
errmsg = (char_u *)_(e_interr);
else
! errmsg = (char_u *)_("E514: write error (file system full?)");
}

// If we have a backup file, try to put it in place of the new file,
--- 2285,2303 ----
if (write_info.bw_conv_error)
{
if (write_info.bw_conv_error_lnum == 0)
! errmsg = (char_u *)_(e_write_error_conversion_failed_make_fenc_empty_to_override);
else
{
errmsg_allocated = TRUE;
errmsg = alloc(300);
! vim_snprintf((char *)errmsg, 300, _(e_write_error_conversion_failed_in_line_nr_make_fenc_empty_to_override),
(long)write_info.bw_conv_error_lnum);
}
}
else if (got_int)
errmsg = (char_u *)_(e_interr);
else
! errmsg = (char_u *)_(e_write_error_file_system_full);
}

// If we have a backup file, try to put it in place of the new file,
*** ../vim-8.2.3959/src/version.c 2021-12-31 18:49:39.149303426 +0000
--- src/version.c 2021-12-31 19:58:23.010284769 +0000
***************
*** 751,752 ****
--- 751,754 ----
{ /* Add new patch number below this line */
+ /**/
+ 3960,
/**/

--
In Joseph Heller's novel "Catch-22", the main character tries to get out of a
war by proving he is crazy. But the mere fact he wants to get out of the war
only shows he isn't crazy -- creating the original "Catch-22".

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages