diff src/menu.c @ 20116:513c62184ed8 v8.2.0613

patch 8.2.0613: Vim9: no check for space before #comment Commit: https://github.com/vim/vim/commit/1966c248814d5195edcd1208ed0e51e664a61283 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Apr 20 22:42:32 2020 +0200 patch 8.2.0613: Vim9: no check for space before #comment Problem: Vim9: no check for space before #comment. Solution: Add space checks.
author Bram Moolenaar <Bram@vim.org>
date Mon, 20 Apr 2020 22:45:04 +0200
parents 3ff714d765ba
children 9064044fd4f6
line wrap: on
line diff
--- a/src/menu.c
+++ b/src/menu.c
@@ -2680,7 +2680,7 @@ ex_menutranslate(exarg_T *eap UNUSED)
     /*
      * ":menutrans clear": clear all translations.
      */
-    if (STRNCMP(arg, "clear", 5) == 0 && ends_excmd(*skipwhite(arg + 5)))
+    if (STRNCMP(arg, "clear", 5) == 0 && ends_excmd2(arg, skipwhite(arg + 5)))
     {
 	tp = (menutrans_T *)menutrans_ga.ga_data;
 	for (i = 0; i < menutrans_ga.ga_len; ++i)
@@ -2703,7 +2703,9 @@ ex_menutranslate(exarg_T *eap UNUSED)
 	to = skipwhite(arg);
 	*arg = NUL;
 	arg = menu_skip_part(to);
-	if (arg == to)
+	if (arg == to || ends_excmd2(eap->arg, from)
+		      || ends_excmd2(eap->arg, to)
+		      || !ends_excmd2(eap->arg, skipwhite(arg)))
 	    emsg(_(e_invarg));
 	else
 	{