Mercurial > vim
comparison src/filepath.c @ 26877:06a137af96f8 v8.2.3967
patch 8.2.3967: error messages are spread out
Commit: https://github.com/vim/vim/commit/460ae5dfca31fa627531c263184849976755cf6b
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Jan 1 14:19:49 2022 +0000
patch 8.2.3967: error messages are spread out
Problem: Error messages are spread out.
Solution: Move more errors to errors.h.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 01 Jan 2022 15:30:05 +0100 |
parents | bce848ec8b1b |
children | aa65d1808bd0 |
comparison
equal
deleted
inserted
replaced
26876:601a973ac16c | 26877:06a137af96f8 |
---|---|
1597 { | 1597 { |
1598 char_u *compare; | 1598 char_u *compare; |
1599 | 1599 |
1600 if (tv->v_type != VAR_DICT) | 1600 if (tv->v_type != VAR_DICT) |
1601 { | 1601 { |
1602 emsg(_(e_dictreq)); | 1602 emsg(_(e_dictionary_required)); |
1603 return FAIL; | 1603 return FAIL; |
1604 } | 1604 } |
1605 | 1605 |
1606 if (dict_find(tv->vval.v_dict, (char_u *)"sort", -1) != NULL) | 1606 if (dict_find(tv->vval.v_dict, (char_u *)"sort", -1) != NULL) |
1607 compare = dict_get_string(tv->vval.v_dict, (char_u *)"sort", FALSE); | 1607 compare = dict_get_string(tv->vval.v_dict, (char_u *)"sort", FALSE); |
1608 else | 1608 else |
1609 { | 1609 { |
1610 semsg(_(e_no_dict_key), "sort"); | 1610 semsg(_(e_dictionary_key_str_required), "sort"); |
1611 return FAIL; | 1611 return FAIL; |
1612 } | 1612 } |
1613 | 1613 |
1614 if (STRCMP(compare, (char_u *) "none") == 0) | 1614 if (STRCMP(compare, (char_u *) "none") == 0) |
1615 *cmp = READDIR_SORT_NONE; | 1615 *cmp = READDIR_SORT_NONE; |
1764 semsg(_(e_src_is_directory), fname); | 1764 semsg(_(e_src_is_directory), fname); |
1765 return; | 1765 return; |
1766 } | 1766 } |
1767 if (*fname == NUL || (fd = mch_fopen((char *)fname, READBIN)) == NULL) | 1767 if (*fname == NUL || (fd = mch_fopen((char *)fname, READBIN)) == NULL) |
1768 { | 1768 { |
1769 semsg(_(e_notopen), *fname == NUL ? (char_u *)_("<empty>") : fname); | 1769 semsg(_(e_cant_open_file_str), *fname == NUL ? (char_u *)_("<empty>") : fname); |
1770 return; | 1770 return; |
1771 } | 1771 } |
1772 | 1772 |
1773 if (blob) | 1773 if (blob) |
1774 { | 1774 { |
1775 if (read_blob(fd, rettv->vval.v_blob) == FAIL) | 1775 if (read_blob(fd, rettv->vval.v_blob) == FAIL) |
1776 { | 1776 { |
1777 semsg(_(e_notread), fname); | 1777 semsg(_(e_cant_read_file_str), fname); |
1778 // An empty blob is returned on error. | 1778 // An empty blob is returned on error. |
1779 blob_free(rettv->vval.v_blob); | 1779 blob_free(rettv->vval.v_blob); |
1780 rettv->vval.v_blob = NULL; | 1780 rettv->vval.v_blob = NULL; |
1781 } | 1781 } |
1782 fclose(fd); | 1782 fclose(fd); |
2297 // Always open the file in binary mode, library functions have a mind of | 2297 // Always open the file in binary mode, library functions have a mind of |
2298 // their own about CR-LF conversion. | 2298 // their own about CR-LF conversion. |
2299 if (*fname == NUL || (fd = mch_fopen((char *)fname, | 2299 if (*fname == NUL || (fd = mch_fopen((char *)fname, |
2300 append ? APPENDBIN : WRITEBIN)) == NULL) | 2300 append ? APPENDBIN : WRITEBIN)) == NULL) |
2301 { | 2301 { |
2302 semsg(_(e_notcreate), *fname == NUL ? (char_u *)_("<empty>") : fname); | 2302 semsg(_(e_cant_create_file_str), *fname == NUL ? (char_u *)_("<empty>") : fname); |
2303 ret = -1; | 2303 ret = -1; |
2304 } | 2304 } |
2305 else if (blob) | 2305 else if (blob) |
2306 { | 2306 { |
2307 if (write_blob(fd, blob) == FAIL) | 2307 if (write_blob(fd, blob) == FAIL) |