mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Merge #5750 from justinmk/jobstart
jobstart(): Return -1 if cmd is non-executable
This commit is contained in:
commit
0fe89fc9d7
@ -11581,7 +11581,7 @@ static void f_jobresize(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
|||||||
rettv->vval.v_number = 1;
|
rettv->vval.v_number = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static char **tv_to_argv(typval_T *cmd_tv, char **cmd)
|
static char **tv_to_argv(typval_T *cmd_tv, char **cmd, bool *executable)
|
||||||
{
|
{
|
||||||
if (cmd_tv->v_type == VAR_STRING) {
|
if (cmd_tv->v_type == VAR_STRING) {
|
||||||
char *cmd_str = (char *)get_tv_string(cmd_tv);
|
char *cmd_str = (char *)get_tv_string(cmd_tv);
|
||||||
@ -11599,7 +11599,7 @@ static char **tv_to_argv(typval_T *cmd_tv, char **cmd)
|
|||||||
list_T *argl = cmd_tv->vval.v_list;
|
list_T *argl = cmd_tv->vval.v_list;
|
||||||
int argc = argl->lv_len;
|
int argc = argl->lv_len;
|
||||||
if (!argc) {
|
if (!argc) {
|
||||||
EMSG(_("Argument vector must have at least one item"));
|
EMSG(_(e_invarg)); // List must have at least one item.
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -11607,9 +11607,8 @@ static char **tv_to_argv(typval_T *cmd_tv, char **cmd)
|
|||||||
|
|
||||||
const char_u *exe = get_tv_string_chk(&argl->lv_first->li_tv);
|
const char_u *exe = get_tv_string_chk(&argl->lv_first->li_tv);
|
||||||
if (!exe || !os_can_exe(exe, NULL, true)) {
|
if (!exe || !os_can_exe(exe, NULL, true)) {
|
||||||
// String is not executable
|
if (exe && executable) {
|
||||||
if (exe) {
|
*executable = false;
|
||||||
EMSG2(e_jobexe, exe);
|
|
||||||
}
|
}
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
@ -11644,8 +11643,10 @@ static void f_jobstart(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
char **argv = tv_to_argv(&argvars[0], NULL);
|
bool executable = true;
|
||||||
|
char **argv = tv_to_argv(&argvars[0], NULL, &executable);
|
||||||
if (!argv) {
|
if (!argv) {
|
||||||
|
rettv->vval.v_number = executable ? 0 : -1;
|
||||||
return; // Did error message in tv_to_argv.
|
return; // Did error message in tv_to_argv.
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -16235,7 +16236,7 @@ static void get_system_output_as_rettv(typval_T *argvars, typval_T *rettv,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// get shell command to execute
|
// get shell command to execute
|
||||||
char **argv = tv_to_argv(&argvars[0], NULL);
|
char **argv = tv_to_argv(&argvars[0], NULL, NULL);
|
||||||
if (!argv) {
|
if (!argv) {
|
||||||
xfree(input);
|
xfree(input);
|
||||||
return; // Already did emsg.
|
return; // Already did emsg.
|
||||||
@ -16468,8 +16469,10 @@ static void f_termopen(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
char *cmd;
|
char *cmd;
|
||||||
char **argv = tv_to_argv(&argvars[0], &cmd);
|
bool executable = true;
|
||||||
|
char **argv = tv_to_argv(&argvars[0], &cmd, &executable);
|
||||||
if (!argv) {
|
if (!argv) {
|
||||||
|
rettv->vval.v_number = executable ? 0 : -1;
|
||||||
return; // Did error message in tv_to_argv.
|
return; // Did error message in tv_to_argv.
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1125,7 +1125,6 @@ EXTERN char_u e_invcmd[] INIT(= N_("E476: Invalid command"));
|
|||||||
EXTERN char_u e_isadir2[] INIT(= N_("E17: \"%s\" is a directory"));
|
EXTERN char_u e_isadir2[] INIT(= N_("E17: \"%s\" is a directory"));
|
||||||
EXTERN char_u e_invjob[] INIT(= N_("E900: Invalid job id"));
|
EXTERN char_u e_invjob[] INIT(= N_("E900: Invalid job id"));
|
||||||
EXTERN char_u e_jobtblfull[] INIT(= N_("E901: Job table is full"));
|
EXTERN char_u e_jobtblfull[] INIT(= N_("E901: Job table is full"));
|
||||||
EXTERN char_u e_jobexe[] INIT(= N_("E902: \"%s\" is not an executable"));
|
|
||||||
EXTERN char_u e_jobspawn[] INIT(= N_(
|
EXTERN char_u e_jobspawn[] INIT(= N_(
|
||||||
"E903: Process for command \"%s\" could not be spawned"));
|
"E903: Process for command \"%s\" could not be spawned"));
|
||||||
EXTERN char_u e_jobnotpty[] INIT(= N_("E904: Job is not connected to a pty"));
|
EXTERN char_u e_jobnotpty[] INIT(= N_("E904: Job is not connected to a pty"));
|
||||||
|
@ -2722,11 +2722,6 @@ msgstr "E49: Ongeldige rolgrootte"
|
|||||||
msgid "E901: Job table is full"
|
msgid "E901: Job table is full"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../globals.h:1022
|
|
||||||
#, c-format
|
|
||||||
msgid "E902: \"%s\" is not an executable"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: ../globals.h:1024
|
#: ../globals.h:1024
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "E364: Library call failed for \"%s()\""
|
msgid "E364: Library call failed for \"%s()\""
|
||||||
|
@ -2717,11 +2717,6 @@ msgstr "E49: La dist
|
|||||||
msgid "E901: Job table is full"
|
msgid "E901: Job table is full"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../globals.h:1022
|
|
||||||
#, c-format
|
|
||||||
msgid "E902: \"%s\" is not an executable"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: ../globals.h:1024
|
#: ../globals.h:1024
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "E364: Library call failed for \"%s()\""
|
msgid "E364: Library call failed for \"%s()\""
|
||||||
|
@ -2763,11 +2763,6 @@ msgstr "E49: Chybn
|
|||||||
msgid "E901: Job table is full"
|
msgid "E901: Job table is full"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../globals.h:1022
|
|
||||||
#, c-format
|
|
||||||
msgid "E902: \"%s\" is not an executable"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: ../globals.h:1024
|
#: ../globals.h:1024
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "E364: Library call failed for \"%s()\""
|
msgid "E364: Library call failed for \"%s()\""
|
||||||
|
@ -2763,11 +2763,6 @@ msgstr "E49: Chybn
|
|||||||
msgid "E901: Job table is full"
|
msgid "E901: Job table is full"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../globals.h:1022
|
|
||||||
#, c-format
|
|
||||||
msgid "E902: \"%s\" is not an executable"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: ../globals.h:1024
|
#: ../globals.h:1024
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "E364: Library call failed for \"%s()\""
|
msgid "E364: Library call failed for \"%s()\""
|
||||||
|
@ -2137,11 +2137,6 @@ msgstr "E900: Ung
|
|||||||
msgid "E901: Job table is full"
|
msgid "E901: Job table is full"
|
||||||
msgstr "E901: Job-Tabelle ist voll"
|
msgstr "E901: Job-Tabelle ist voll"
|
||||||
|
|
||||||
#: ../globals.h:1021
|
|
||||||
#, c-format
|
|
||||||
msgid "E902: \"%s\" is not an executable"
|
|
||||||
msgstr "E902: \"%s\" ist nicht ausführbar"
|
|
||||||
|
|
||||||
#: ../globals.h:1023
|
#: ../globals.h:1023
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "E364: Library call failed for \"%s()\""
|
msgid "E364: Library call failed for \"%s()\""
|
||||||
|
@ -2623,11 +2623,6 @@ msgstr ""
|
|||||||
msgid "E901: Job table is full"
|
msgid "E901: Job table is full"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../globals.h:1022
|
|
||||||
#, c-format
|
|
||||||
msgid "E902: \"%s\" is not an executable"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: ../globals.h:1024
|
#: ../globals.h:1024
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "E364: Library call failed for \"%s()\""
|
msgid "E364: Library call failed for \"%s()\""
|
||||||
|
@ -2697,11 +2697,6 @@ msgstr "E49: Nevalida grando de rulumo"
|
|||||||
msgid "E901: Job table is full"
|
msgid "E901: Job table is full"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../globals.h:1022
|
|
||||||
#, c-format
|
|
||||||
msgid "E902: \"%s\" is not an executable"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: ../globals.h:1024
|
#: ../globals.h:1024
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "E364: Library call failed for \"%s()\""
|
msgid "E364: Library call failed for \"%s()\""
|
||||||
|
@ -2748,11 +2748,6 @@ msgstr "E49: La longitud de desplazamiento no es válida"
|
|||||||
msgid "E901: Job table is full"
|
msgid "E901: Job table is full"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../globals.h:1022
|
|
||||||
#, c-format
|
|
||||||
msgid "E902: \"%s\" is not an executable"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: ../globals.h:1024
|
#: ../globals.h:1024
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "E364: Library call failed for \"%s()\""
|
msgid "E364: Library call failed for \"%s()\""
|
||||||
|
@ -2691,11 +2691,6 @@ msgstr "E49: Virheellinen vierityskoko"
|
|||||||
msgid "E901: Job table is full"
|
msgid "E901: Job table is full"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../globals.h:1022
|
|
||||||
#, c-format
|
|
||||||
msgid "E902: \"%s\" is not an executable"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: ../globals.h:1024
|
#: ../globals.h:1024
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "E364: Library call failed for \"%s()\""
|
msgid "E364: Library call failed for \"%s()\""
|
||||||
|
@ -2879,11 +2879,6 @@ msgstr "E49: Valeur de d
|
|||||||
msgid "E901: Job table is full"
|
msgid "E901: Job table is full"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../globals.h:1022
|
|
||||||
#, c-format
|
|
||||||
msgid "E902: \"%s\" is not an executable"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: ../globals.h:1024
|
#: ../globals.h:1024
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "E364: Library call failed for \"%s()\""
|
msgid "E364: Library call failed for \"%s()\""
|
||||||
|
@ -2684,11 +2684,6 @@ msgstr "E49: M
|
|||||||
msgid "E901: Job table is full"
|
msgid "E901: Job table is full"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../globals.h:1022
|
|
||||||
#, c-format
|
|
||||||
msgid "E902: \"%s\" is not an executable"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: ../globals.h:1024
|
#: ../globals.h:1024
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "E364: Library call failed for \"%s()\""
|
msgid "E364: Library call failed for \"%s()\""
|
||||||
|
@ -2704,11 +2704,6 @@ msgstr "E900: 'Job id' non valido"
|
|||||||
msgid "E901: Job table is full"
|
msgid "E901: Job table is full"
|
||||||
msgstr "E901: Job table piena"
|
msgstr "E901: Job table piena"
|
||||||
|
|
||||||
#: ../globals.h:1022
|
|
||||||
#, c-format
|
|
||||||
msgid "E902: \"%s\" is not an executable"
|
|
||||||
msgstr "E902: \"%s\" non è un esegubile"
|
|
||||||
|
|
||||||
#: ../globals.h:1024
|
#: ../globals.h:1024
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "E364: Library call failed for \"%s()\""
|
msgid "E364: Library call failed for \"%s()\""
|
||||||
|
@ -2684,11 +2684,6 @@ msgstr "E49: ̵
|
|||||||
msgid "E901: Job table is full"
|
msgid "E901: Job table is full"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../globals.h:1022
|
|
||||||
#, c-format
|
|
||||||
msgid "E902: \"%s\" is not an executable"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: ../globals.h:1024
|
#: ../globals.h:1024
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "E364: Library call failed for \"%s()\""
|
msgid "E364: Library call failed for \"%s()\""
|
||||||
|
@ -2683,11 +2683,6 @@ msgstr "E49: 無効なスクロール量です"
|
|||||||
msgid "E901: Job table is full"
|
msgid "E901: Job table is full"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../globals.h:1022
|
|
||||||
#, c-format
|
|
||||||
msgid "E902: \"%s\" is not an executable"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: ../globals.h:1024
|
#: ../globals.h:1024
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "E364: Library call failed for \"%s()\""
|
msgid "E364: Library call failed for \"%s()\""
|
||||||
|
@ -2648,11 +2648,6 @@ msgstr "E49: 스크롤 크기가 잘못되었습니다"
|
|||||||
msgid "E901: Job table is full"
|
msgid "E901: Job table is full"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../globals.h:1022
|
|
||||||
#, c-format
|
|
||||||
msgid "E902: \"%s\" is not an executable"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: ../globals.h:1024
|
#: ../globals.h:1024
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "E364: Library call failed for \"%s()\""
|
msgid "E364: Library call failed for \"%s()\""
|
||||||
|
@ -2699,11 +2699,6 @@ msgstr "E49: Ugyldig \"scroll\"-verdi"
|
|||||||
msgid "E901: Job table is full"
|
msgid "E901: Job table is full"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../globals.h:1022
|
|
||||||
#, c-format
|
|
||||||
msgid "E902: \"%s\" is not an executable"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: ../globals.h:1024
|
#: ../globals.h:1024
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "E364: Library call failed for \"%s()\""
|
msgid "E364: Library call failed for \"%s()\""
|
||||||
|
@ -2685,11 +2685,6 @@ msgstr "E49: ongeldige scroll-grootte"
|
|||||||
msgid "E901: Job table is full"
|
msgid "E901: Job table is full"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../globals.h:1022
|
|
||||||
#, c-format
|
|
||||||
msgid "E902: \"%s\" is not an executable"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: ../globals.h:1024
|
#: ../globals.h:1024
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "E364: Library call failed for \"%s()\""
|
msgid "E364: Library call failed for \"%s()\""
|
||||||
|
@ -2699,11 +2699,6 @@ msgstr "E49: Ugyldig \"scroll\"-verdi"
|
|||||||
msgid "E901: Job table is full"
|
msgid "E901: Job table is full"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../globals.h:1022
|
|
||||||
#, c-format
|
|
||||||
msgid "E902: \"%s\" is not an executable"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: ../globals.h:1024
|
#: ../globals.h:1024
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "E364: Library call failed for \"%s()\""
|
msgid "E364: Library call failed for \"%s()\""
|
||||||
|
@ -2658,11 +2658,6 @@ msgstr "E49: Niewłaściwa wielkość przewinięcia"
|
|||||||
msgid "E901: Job table is full"
|
msgid "E901: Job table is full"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../globals.h:1022
|
|
||||||
#, c-format
|
|
||||||
msgid "E902: \"%s\" is not an executable"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: ../globals.h:1024
|
#: ../globals.h:1024
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "E364: Library call failed for \"%s()\""
|
msgid "E364: Library call failed for \"%s()\""
|
||||||
|
@ -2478,11 +2478,6 @@ msgstr "E900: Id do job
|
|||||||
msgid "E901: Job table is full"
|
msgid "E901: Job table is full"
|
||||||
msgstr "E901: Tabela de jobs está cheia"
|
msgstr "E901: Tabela de jobs está cheia"
|
||||||
|
|
||||||
#: ../globals.h:1021
|
|
||||||
#, c-format
|
|
||||||
msgid "E902: \"%s\" is not an executable"
|
|
||||||
msgstr "E902: \"%s\" não é um executável"
|
|
||||||
|
|
||||||
#: ../globals.h:1023
|
#: ../globals.h:1023
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "E364: Library call failed for \"%s()\""
|
msgid "E364: Library call failed for \"%s()\""
|
||||||
|
@ -2676,11 +2676,6 @@ msgstr "E49: Недопустимый размер прокрутки"
|
|||||||
msgid "E901: Job table is full"
|
msgid "E901: Job table is full"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../globals.h:1022
|
|
||||||
#, c-format
|
|
||||||
msgid "E902: \"%s\" is not an executable"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: ../globals.h:1024
|
#: ../globals.h:1024
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "E364: Library call failed for \"%s()\""
|
msgid "E364: Library call failed for \"%s()\""
|
||||||
|
@ -2689,11 +2689,6 @@ msgstr "E49: Chybn
|
|||||||
msgid "E901: Job table is full"
|
msgid "E901: Job table is full"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../globals.h:1022
|
|
||||||
#, c-format
|
|
||||||
msgid "E902: \"%s\" is not an executable"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: ../globals.h:1024
|
#: ../globals.h:1024
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "E364: Library call failed for \"%s()\""
|
msgid "E364: Library call failed for \"%s()\""
|
||||||
|
@ -2689,11 +2689,6 @@ msgstr "E49: Chybn
|
|||||||
msgid "E901: Job table is full"
|
msgid "E901: Job table is full"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../globals.h:1022
|
|
||||||
#, c-format
|
|
||||||
msgid "E902: \"%s\" is not an executable"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: ../globals.h:1024
|
#: ../globals.h:1024
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "E364: Library call failed for \"%s()\""
|
msgid "E364: Library call failed for \"%s()\""
|
||||||
|
@ -4742,11 +4742,6 @@ msgstr "E900: Ogiltigt jobb-id"
|
|||||||
msgid "E901: Job table is full"
|
msgid "E901: Job table is full"
|
||||||
msgstr "E901: Jobbtabellen är full"
|
msgstr "E901: Jobbtabellen är full"
|
||||||
|
|
||||||
#: ../globals.h:1008
|
|
||||||
#, c-format
|
|
||||||
msgid "E902: \"%s\" is not an executable"
|
|
||||||
msgstr "E902: \"%s\" är inte körbar"
|
|
||||||
|
|
||||||
#: ../globals.h:1009
|
#: ../globals.h:1009
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "E364: Library call failed for \"%s()\""
|
msgid "E364: Library call failed for \"%s()\""
|
||||||
|
@ -2432,10 +2432,6 @@ msgstr "E900: Некоректний ід. завдання"
|
|||||||
msgid "E901: Job table is full"
|
msgid "E901: Job table is full"
|
||||||
msgstr "E901: Таблиця завдань заповнена"
|
msgstr "E901: Таблиця завдань заповнена"
|
||||||
|
|
||||||
#, c-format
|
|
||||||
msgid "E902: \"%s\" is not an executable"
|
|
||||||
msgstr "E902: \"%s\" не можна виконати"
|
|
||||||
|
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "E903: Process for command \"%s\" could not be spawned"
|
msgid "E903: Process for command \"%s\" could not be spawned"
|
||||||
msgstr "E903: Не вдалося запустити процес для команди «%s»"
|
msgstr "E903: Не вдалося запустити процес для команди «%s»"
|
||||||
|
@ -2720,11 +2720,6 @@ msgstr "E49: Kích thước thanh cuộn không cho phép"
|
|||||||
msgid "E901: Job table is full"
|
msgid "E901: Job table is full"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../globals.h:1022
|
|
||||||
#, c-format
|
|
||||||
msgid "E902: \"%s\" is not an executable"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: ../globals.h:1024
|
#: ../globals.h:1024
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "E364: Library call failed for \"%s()\""
|
msgid "E364: Library call failed for \"%s()\""
|
||||||
|
@ -2675,11 +2675,6 @@ msgstr "E49: 无效的滚动大小"
|
|||||||
msgid "E901: Job table is full"
|
msgid "E901: Job table is full"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../globals.h:1022
|
|
||||||
#, c-format
|
|
||||||
msgid "E902: \"%s\" is not an executable"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: ../globals.h:1024
|
#: ../globals.h:1024
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "E364: Library call failed for \"%s()\""
|
msgid "E364: Library call failed for \"%s()\""
|
||||||
|
@ -2725,11 +2725,6 @@ msgstr "E49: 錯誤的捲動大小"
|
|||||||
msgid "E901: Job table is full"
|
msgid "E901: Job table is full"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
#: ../globals.h:1022
|
|
||||||
#, c-format
|
|
||||||
msgid "E902: \"%s\" is not an executable"
|
|
||||||
msgstr ""
|
|
||||||
|
|
||||||
#: ../globals.h:1024
|
#: ../globals.h:1024
|
||||||
#, c-format
|
#, c-format
|
||||||
msgid "E364: Library call failed for \"%s()\""
|
msgid "E364: Library call failed for \"%s()\""
|
||||||
|
@ -65,9 +65,22 @@ describe('jobs', function()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
it('returns 0 when it fails to start', function()
|
it('returns 0 when it fails to start', function()
|
||||||
local status, rv = pcall(eval, "jobstart([])")
|
eq("", eval("v:errmsg"))
|
||||||
eq(false, status)
|
execute("let g:test_jobid = jobstart([])")
|
||||||
ok(rv ~= nil)
|
eq(0, eval("g:test_jobid"))
|
||||||
|
eq("E474:", string.match(eval("v:errmsg"), "E%d*:"))
|
||||||
|
end)
|
||||||
|
|
||||||
|
it('returns -1 when target is not executable #5465', function()
|
||||||
|
local function new_job() return eval([[jobstart(['echo', 'foo'])]]) end
|
||||||
|
local executable_jobid = new_job()
|
||||||
|
local nonexecutable_jobid = eval(
|
||||||
|
"jobstart(['./test/functional/fixtures/non_executable.txt'])")
|
||||||
|
eq(-1, nonexecutable_jobid)
|
||||||
|
-- Should _not_ throw an error.
|
||||||
|
eq("", eval("v:errmsg"))
|
||||||
|
-- Non-executable job should not increment the job ids. #5465
|
||||||
|
eq(executable_jobid + 1, new_job())
|
||||||
end)
|
end)
|
||||||
|
|
||||||
it('invokes callbacks when the job writes and exits', function()
|
it('invokes callbacks when the job writes and exits', function()
|
||||||
|
1
test/functional/fixtures/non_executable.txt
Normal file
1
test/functional/fixtures/non_executable.txt
Normal file
@ -0,0 +1 @@
|
|||||||
|
This file is not an executable
|
Loading…
Reference in New Issue
Block a user