mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
Fix a few compiler warnings. Fix crash with encrypted undo file.
This commit is contained in:
parent
860cae1cec
commit
56be950094
@ -1376,6 +1376,9 @@ check if the encryption works as expected. If you get one of these errors
|
|||||||
don't write the file encrypted! You need to rebuild the Vim binary to fix
|
don't write the file encrypted! You need to rebuild the Vim binary to fix
|
||||||
this.
|
this.
|
||||||
|
|
||||||
|
*E831* This is an internal error, "cannot happen". If you can reproduc it,
|
||||||
|
please report to the developers.
|
||||||
|
|
||||||
When reading a file that has been encrypted and the 'key' option is not empty,
|
When reading a file that has been encrypted and the 'key' option is not empty,
|
||||||
it will be used for decryption. If the value is empty, you will be prompted
|
it will be used for decryption. If the value is empty, you will be prompted
|
||||||
to enter the key. If you don't enter a key, or you enter the wrong key, the
|
to enter the key. If you don't enter a key, or you enter the wrong key, the
|
||||||
|
@ -4183,10 +4183,14 @@ E822 undo.txt /*E822*
|
|||||||
E823 undo.txt /*E823*
|
E823 undo.txt /*E823*
|
||||||
E824 undo.txt /*E824*
|
E824 undo.txt /*E824*
|
||||||
E825 undo.txt /*E825*
|
E825 undo.txt /*E825*
|
||||||
|
E826 undo.txt /*E826*
|
||||||
|
E827 undo.txt /*E827*
|
||||||
E828 undo.txt /*E828*
|
E828 undo.txt /*E828*
|
||||||
E829 undo.txt /*E829*
|
E829 undo.txt /*E829*
|
||||||
E83 message.txt /*E83*
|
E83 message.txt /*E83*
|
||||||
E830 undo.txt /*E830*
|
E830 undo.txt /*E830*
|
||||||
|
E831 editing.txt /*E831*
|
||||||
|
E832 undo.txt /*E832*
|
||||||
E84 windows.txt /*E84*
|
E84 windows.txt /*E84*
|
||||||
E85 options.txt /*E85*
|
E85 options.txt /*E85*
|
||||||
E86 windows.txt /*E86*
|
E86 windows.txt /*E86*
|
||||||
|
@ -30,6 +30,8 @@ be worked on, but only if you sponsor Vim development. See |sponsor|.
|
|||||||
*known-bugs*
|
*known-bugs*
|
||||||
-------------------- Known bugs and current work -----------------------
|
-------------------- Known bugs and current work -----------------------
|
||||||
|
|
||||||
|
gtk_selection_clear_targets not available in GTK1 (Patrick Texier)
|
||||||
|
|
||||||
Cursor positioning wrong with 0x200e character. (John Becket, 2010 May 6)
|
Cursor positioning wrong with 0x200e character. (John Becket, 2010 May 6)
|
||||||
|
|
||||||
E315 when trying to change a file in FileChangedRO autocommand event.
|
E315 when trying to change a file in FileChangedRO autocommand event.
|
||||||
|
@ -285,6 +285,13 @@ Reading an existing undo file may fail for several reasons:
|
|||||||
the undo file cannot be used, it would corrupt the text. This also
|
the undo file cannot be used, it would corrupt the text. This also
|
||||||
happens when 'encoding' differs from when the undo file was written.
|
happens when 'encoding' differs from when the undo file was written.
|
||||||
*E825* The undo file does not contain valid contents and cannot be used.
|
*E825* The undo file does not contain valid contents and cannot be used.
|
||||||
|
*E826* The undo file is encrypted but decryption failed.
|
||||||
|
*E827* The undo file is encrypted but this version of Vim does not support
|
||||||
|
encryption. Open the file with another Vim.
|
||||||
|
*E832* The undo file is encrypted but 'key' is not set, the text file is not
|
||||||
|
encrypted. This would happen if the text file was written by Vim
|
||||||
|
encrypted at first, and later overwritten by not encrypted text.
|
||||||
|
You probably want to delete this undo file.
|
||||||
"Not reading undo file, owner differs"
|
"Not reading undo file, owner differs"
|
||||||
The undo file is owned by someone else than the owner of the text
|
The undo file is owned by someone else than the owner of the text
|
||||||
file. For safety the undo file is not used.
|
file. For safety the undo file is not used.
|
||||||
|
@ -413,6 +413,11 @@ bf_key_init(password)
|
|||||||
|
|
||||||
key = sha256_key(password);
|
key = sha256_key(password);
|
||||||
keylen = (int)STRLEN(key);
|
keylen = (int)STRLEN(key);
|
||||||
|
if (keylen == 0)
|
||||||
|
{
|
||||||
|
EMSG(_("E831: bf_key_init() called with empty password"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
for (i = 0; i < 256; ++i)
|
for (i = 0; i < 256; ++i)
|
||||||
{
|
{
|
||||||
sbx[0][i] = sbi[0][i];
|
sbx[0][i] = sbi[0][i];
|
||||||
|
@ -127,7 +127,7 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Message history is fixed at 100 message, 20 for the tiny version.
|
* Message history is fixed at 200 message, 20 for the tiny version.
|
||||||
*/
|
*/
|
||||||
#ifdef FEAT_SMALL
|
#ifdef FEAT_SMALL
|
||||||
# define MAX_MSG_HIST_LEN 200
|
# define MAX_MSG_HIST_LEN 200
|
||||||
|
@ -20,6 +20,7 @@ general_beval_cb(beval, state)
|
|||||||
BalloonEval *beval;
|
BalloonEval *beval;
|
||||||
int state UNUSED;
|
int state UNUSED;
|
||||||
{
|
{
|
||||||
|
#ifdef FEAT_EVAL
|
||||||
win_T *wp;
|
win_T *wp;
|
||||||
int col;
|
int col;
|
||||||
int use_sandbox;
|
int use_sandbox;
|
||||||
@ -29,8 +30,9 @@ general_beval_cb(beval, state)
|
|||||||
long winnr = 0;
|
long winnr = 0;
|
||||||
char_u *bexpr;
|
char_u *bexpr;
|
||||||
buf_T *save_curbuf;
|
buf_T *save_curbuf;
|
||||||
#ifdef FEAT_WINDOWS
|
# ifdef FEAT_WINDOWS
|
||||||
win_T *cw;
|
win_T *cw;
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
static int recursive = FALSE;
|
static int recursive = FALSE;
|
||||||
|
|
||||||
|
@ -56,10 +56,10 @@ static char_u *menu_skip_part __ARGS((char_u *p));
|
|||||||
#endif
|
#endif
|
||||||
#ifdef FEAT_MULTI_LANG
|
#ifdef FEAT_MULTI_LANG
|
||||||
static char_u *menutrans_lookup __ARGS((char_u *name, int len));
|
static char_u *menutrans_lookup __ARGS((char_u *name, int len));
|
||||||
|
static void menu_unescape_name __ARGS((char_u *p));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
static char_u *menu_translate_tab_and_shift __ARGS((char_u *arg_start));
|
static char_u *menu_translate_tab_and_shift __ARGS((char_u *arg_start));
|
||||||
static void menu_unescape_name __ARGS((char_u *p));
|
|
||||||
|
|
||||||
/* The character for each menu mode */
|
/* The character for each menu mode */
|
||||||
static char_u menu_mode_chars[] = {'n', 'v', 's', 'o', 'i', 'c', 't'};
|
static char_u menu_mode_chars[] = {'n', 'v', 's', 'o', 'i', 'c', 't'};
|
||||||
@ -2525,7 +2525,6 @@ menutrans_lookup(name, len)
|
|||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
#endif /* FEAT_MULTI_LANG */
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Unescape the name in the translate dictionary table.
|
* Unescape the name in the translate dictionary table.
|
||||||
@ -2540,6 +2539,7 @@ menu_unescape_name(name)
|
|||||||
if (*p == '\\')
|
if (*p == '\\')
|
||||||
STRMOVE(p, p + 1);
|
STRMOVE(p, p + 1);
|
||||||
}
|
}
|
||||||
|
#endif /* FEAT_MULTI_LANG */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Isolate the menu name.
|
* Isolate the menu name.
|
||||||
|
@ -235,7 +235,7 @@ static char_u **syn_cmdlinep;
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Another Annoying Hack(TM): To prevent rules from other ":syn include"'d
|
* Another Annoying Hack(TM): To prevent rules from other ":syn include"'d
|
||||||
* files from from leaking into ALLBUT lists, we assign a unique ID to the
|
* files from leaking into ALLBUT lists, we assign a unique ID to the
|
||||||
* rules in each ":syn include"'d file.
|
* rules in each ":syn include"'d file.
|
||||||
*/
|
*/
|
||||||
static int current_syn_inc_tag = 0;
|
static int current_syn_inc_tag = 0;
|
||||||
@ -4500,11 +4500,13 @@ get_syn_options(arg, opt, conceal_char)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
|
{
|
||||||
#ifdef FEAT_CONCEAL
|
#ifdef FEAT_CONCEAL
|
||||||
*conceal_char = arg[6];
|
*conceal_char = arg[6];
|
||||||
#else
|
#else
|
||||||
;
|
;
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
arg = skipwhite(arg + 7);
|
arg = skipwhite(arg + 7);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1503,13 +1503,19 @@ u_read_undo(name, hash, orig_name)
|
|||||||
if (version == UF_VERSION_CRYPT)
|
if (version == UF_VERSION_CRYPT)
|
||||||
{
|
{
|
||||||
#ifdef FEAT_CRYPT
|
#ifdef FEAT_CRYPT
|
||||||
|
if (*curbuf->b_p_key == NUL)
|
||||||
|
{
|
||||||
|
EMSG2(_("E832: Non-encrypted file has encrypted undo file: %s"),
|
||||||
|
file_name);
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
if (prepare_crypt_read(fp) == FAIL)
|
if (prepare_crypt_read(fp) == FAIL)
|
||||||
{
|
{
|
||||||
EMSG2(_("E826: Undo file decryption failed: %s"), file_name);
|
EMSG2(_("E826: Undo file decryption failed: %s"), file_name);
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
EMSG2(_("E826: Undo file is encrypted: %s"), file_name);
|
EMSG2(_("E827: Undo file is encrypted: %s"), file_name);
|
||||||
goto error;
|
goto error;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user