|
|
22c937 |
To: vim_dev@googlegroups.com
|
|
|
22c937 |
Subject: Patch 7.4.248
|
|
|
22c937 |
Fcc: outbox
|
|
|
22c937 |
From: Bram Moolenaar <Bram@moolenaar.net>
|
|
|
22c937 |
Mime-Version: 1.0
|
|
|
22c937 |
Content-Type: text/plain; charset=UTF-8
|
|
|
22c937 |
Content-Transfer-Encoding: 8bit
|
|
|
22c937 |
------------
|
|
|
22c937 |
|
|
|
22c937 |
Patch 7.4.248
|
|
|
22c937 |
Problem: Cannot distinguish between NL and NUL in output of system().
|
|
|
22c937 |
Solution: Add systemlist(). (ZyX)
|
|
|
22c937 |
Files: runtime/doc/eval.txt, src/eval.c, src/ex_cmds2.c, src/misc1.c,
|
|
|
22c937 |
src/proto/misc1.pro
|
|
|
22c937 |
|
|
|
22c937 |
|
|
|
22c937 |
*** ../vim-7.4.247/runtime/doc/eval.txt 2014-04-05 18:55:40.471154309 +0200
|
|
|
22c937 |
--- runtime/doc/eval.txt 2014-04-05 19:03:05.419155281 +0200
|
|
|
22c937 |
***************
|
|
|
22c937 |
*** 2001,2006 ****
|
|
|
22c937 |
--- 2002,2008 ----
|
|
|
22c937 |
synconcealed( {lnum}, {col}) List info about concealing
|
|
|
22c937 |
synstack( {lnum}, {col}) List stack of syntax IDs at {lnum} and {col}
|
|
|
22c937 |
system( {expr} [, {input}]) String output of shell command/filter {expr}
|
|
|
22c937 |
+ systemlist( {expr} [, {input}]) List output of shell command/filter {expr}
|
|
|
22c937 |
tabpagebuflist( [{arg}]) List list of buffer numbers in tab page
|
|
|
22c937 |
tabpagenr( [{arg}]) Number number of current or last tab page
|
|
|
22c937 |
tabpagewinnr( {tabarg}[, {arg}])
|
|
|
22c937 |
***************
|
|
|
22c937 |
*** 5950,5956 ****
|
|
|
22c937 |
valid positions.
|
|
|
22c937 |
|
|
|
22c937 |
system({expr} [, {input}]) *system()* *E677*
|
|
|
22c937 |
! Get the output of the shell command {expr}.
|
|
|
22c937 |
|
|
|
22c937 |
When {input} is given and is a string this string is written
|
|
|
22c937 |
to a file and passed as stdin to the command. The string is
|
|
|
22c937 |
--- 5964,5971 ----
|
|
|
22c937 |
valid positions.
|
|
|
22c937 |
|
|
|
22c937 |
system({expr} [, {input}]) *system()* *E677*
|
|
|
22c937 |
! Get the output of the shell command {expr} as a string. See
|
|
|
22c937 |
! |systemlist()| to get the output as a List.
|
|
|
22c937 |
|
|
|
22c937 |
When {input} is given and is a string this string is written
|
|
|
22c937 |
to a file and passed as stdin to the command. The string is
|
|
|
22c937 |
***************
|
|
|
22c937 |
*** 5998,6003 ****
|
|
|
22c937 |
--- 6013,6028 ----
|
|
|
22c937 |
Use |:checktime| to force a check.
|
|
|
22c937 |
|
|
|
22c937 |
|
|
|
22c937 |
+ systemlist({expr} [, {input}]) *systemlist()*
|
|
|
22c937 |
+ Same as |system()|, but returns a |List| with lines (parts of
|
|
|
22c937 |
+ output separated by NL) with NULs transformed into NLs. Output
|
|
|
22c937 |
+ is the same as |readfile()| will output with {binary} argument
|
|
|
22c937 |
+ set to "b".
|
|
|
22c937 |
+
|
|
|
22c937 |
+ Returns an empty string on error, so be careful not to run
|
|
|
22c937 |
+ into |E706|.
|
|
|
22c937 |
+
|
|
|
22c937 |
+
|
|
|
22c937 |
tabpagebuflist([{arg}]) *tabpagebuflist()*
|
|
|
22c937 |
The result is a |List|, where each item is the number of the
|
|
|
22c937 |
buffer associated with each window in the current tab page.
|
|
|
22c937 |
*** ../vim-7.4.247/src/eval.c 2014-04-05 18:55:40.479154309 +0200
|
|
|
22c937 |
--- src/eval.c 2014-04-05 19:42:37.675160463 +0200
|
|
|
22c937 |
***************
|
|
|
22c937 |
*** 726,731 ****
|
|
|
22c937 |
--- 726,732 ----
|
|
|
22c937 |
static void f_synstack __ARGS((typval_T *argvars, typval_T *rettv));
|
|
|
22c937 |
static void f_synconcealed __ARGS((typval_T *argvars, typval_T *rettv));
|
|
|
22c937 |
static void f_system __ARGS((typval_T *argvars, typval_T *rettv));
|
|
|
22c937 |
+ static void f_systemlist __ARGS((typval_T *argvars, typval_T *rettv));
|
|
|
22c937 |
static void f_tabpagebuflist __ARGS((typval_T *argvars, typval_T *rettv));
|
|
|
22c937 |
static void f_tabpagenr __ARGS((typval_T *argvars, typval_T *rettv));
|
|
|
22c937 |
static void f_tabpagewinnr __ARGS((typval_T *argvars, typval_T *rettv));
|
|
|
22c937 |
***************
|
|
|
22c937 |
*** 837,842 ****
|
|
|
22c937 |
--- 838,844 ----
|
|
|
22c937 |
static int search_cmn __ARGS((typval_T *argvars, pos_T *match_pos, int *flagsp));
|
|
|
22c937 |
static void setwinvar __ARGS((typval_T *argvars, typval_T *rettv, int off));
|
|
|
22c937 |
static int write_list __ARGS((FILE *fd, list_T *list, int binary));
|
|
|
22c937 |
+ static void get_cmd_output_as_rettv __ARGS((typval_T *argvars, typval_T *rettv, int retlist));
|
|
|
22c937 |
|
|
|
22c937 |
|
|
|
22c937 |
#ifdef EBCDIC
|
|
|
22c937 |
***************
|
|
|
22c937 |
*** 8139,8144 ****
|
|
|
22c937 |
--- 8141,8147 ----
|
|
|
22c937 |
{"synconcealed", 2, 2, f_synconcealed},
|
|
|
22c937 |
{"synstack", 2, 2, f_synstack},
|
|
|
22c937 |
{"system", 1, 2, f_system},
|
|
|
22c937 |
+ {"systemlist", 1, 2, f_systemlist},
|
|
|
22c937 |
{"tabpagebuflist", 0, 1, f_tabpagebuflist},
|
|
|
22c937 |
{"tabpagenr", 0, 1, f_tabpagenr},
|
|
|
22c937 |
{"tabpagewinnr", 1, 2, f_tabpagewinnr},
|
|
|
22c937 |
***************
|
|
|
22c937 |
*** 18232,18244 ****
|
|
|
22c937 |
#endif
|
|
|
22c937 |
}
|
|
|
22c937 |
|
|
|
22c937 |
- /*
|
|
|
22c937 |
- * "system()" function
|
|
|
22c937 |
- */
|
|
|
22c937 |
static void
|
|
|
22c937 |
! f_system(argvars, rettv)
|
|
|
22c937 |
typval_T *argvars;
|
|
|
22c937 |
typval_T *rettv;
|
|
|
22c937 |
{
|
|
|
22c937 |
char_u *res = NULL;
|
|
|
22c937 |
char_u *p;
|
|
|
22c937 |
--- 18235,18245 ----
|
|
|
22c937 |
#endif
|
|
|
22c937 |
}
|
|
|
22c937 |
|
|
|
22c937 |
static void
|
|
|
22c937 |
! get_cmd_output_as_rettv(argvars, rettv, retlist)
|
|
|
22c937 |
typval_T *argvars;
|
|
|
22c937 |
typval_T *rettv;
|
|
|
22c937 |
+ int retlist;
|
|
|
22c937 |
{
|
|
|
22c937 |
char_u *res = NULL;
|
|
|
22c937 |
char_u *p;
|
|
|
22c937 |
***************
|
|
|
22c937 |
*** 18246,18254 ****
|
|
|
22c937 |
char_u buf[NUMBUFLEN];
|
|
|
22c937 |
int err = FALSE;
|
|
|
22c937 |
FILE *fd;
|
|
|
22c937 |
|
|
|
22c937 |
if (check_restricted() || check_secure())
|
|
|
22c937 |
! goto done;
|
|
|
22c937 |
|
|
|
22c937 |
if (argvars[1].v_type != VAR_UNKNOWN)
|
|
|
22c937 |
{
|
|
|
22c937 |
--- 18247,18258 ----
|
|
|
22c937 |
char_u buf[NUMBUFLEN];
|
|
|
22c937 |
int err = FALSE;
|
|
|
22c937 |
FILE *fd;
|
|
|
22c937 |
+ list_T *list = NULL;
|
|
|
22c937 |
|
|
|
22c937 |
+ rettv->v_type = VAR_STRING;
|
|
|
22c937 |
+ rettv->vval.v_string = NULL;
|
|
|
22c937 |
if (check_restricted() || check_secure())
|
|
|
22c937 |
! goto errret;
|
|
|
22c937 |
|
|
|
22c937 |
if (argvars[1].v_type != VAR_UNKNOWN)
|
|
|
22c937 |
{
|
|
|
22c937 |
***************
|
|
|
22c937 |
*** 18259,18272 ****
|
|
|
22c937 |
if ((infile = vim_tempname('i')) == NULL)
|
|
|
22c937 |
{
|
|
|
22c937 |
EMSG(_(e_notmp));
|
|
|
22c937 |
! goto done;
|
|
|
22c937 |
}
|
|
|
22c937 |
|
|
|
22c937 |
fd = mch_fopen((char *)infile, WRITEBIN);
|
|
|
22c937 |
if (fd == NULL)
|
|
|
22c937 |
{
|
|
|
22c937 |
EMSG2(_(e_notopen), infile);
|
|
|
22c937 |
! goto done;
|
|
|
22c937 |
}
|
|
|
22c937 |
if (argvars[1].v_type == VAR_LIST)
|
|
|
22c937 |
{
|
|
|
22c937 |
--- 18263,18276 ----
|
|
|
22c937 |
if ((infile = vim_tempname('i')) == NULL)
|
|
|
22c937 |
{
|
|
|
22c937 |
EMSG(_(e_notmp));
|
|
|
22c937 |
! goto errret;
|
|
|
22c937 |
}
|
|
|
22c937 |
|
|
|
22c937 |
fd = mch_fopen((char *)infile, WRITEBIN);
|
|
|
22c937 |
if (fd == NULL)
|
|
|
22c937 |
{
|
|
|
22c937 |
EMSG2(_(e_notopen), infile);
|
|
|
22c937 |
! goto errret;
|
|
|
22c937 |
}
|
|
|
22c937 |
if (argvars[1].v_type == VAR_LIST)
|
|
|
22c937 |
{
|
|
|
22c937 |
***************
|
|
|
22c937 |
*** 18279,18285 ****
|
|
|
22c937 |
if (p == NULL)
|
|
|
22c937 |
{
|
|
|
22c937 |
fclose(fd);
|
|
|
22c937 |
! goto done; /* type error; errmsg already given */
|
|
|
22c937 |
}
|
|
|
22c937 |
if (fwrite(p, STRLEN(p), 1, fd) != 1)
|
|
|
22c937 |
err = TRUE;
|
|
|
22c937 |
--- 18283,18289 ----
|
|
|
22c937 |
if (p == NULL)
|
|
|
22c937 |
{
|
|
|
22c937 |
fclose(fd);
|
|
|
22c937 |
! goto errret; /* type error; errmsg already given */
|
|
|
22c937 |
}
|
|
|
22c937 |
if (fwrite(p, STRLEN(p), 1, fd) != 1)
|
|
|
22c937 |
err = TRUE;
|
|
|
22c937 |
***************
|
|
|
22c937 |
*** 18289,18340 ****
|
|
|
22c937 |
if (err)
|
|
|
22c937 |
{
|
|
|
22c937 |
EMSG(_("E677: Error writing temp file"));
|
|
|
22c937 |
! goto done;
|
|
|
22c937 |
}
|
|
|
22c937 |
}
|
|
|
22c937 |
|
|
|
22c937 |
! res = get_cmd_output(get_tv_string(&argvars[0]), infile,
|
|
|
22c937 |
! SHELL_SILENT | SHELL_COOKED);
|
|
|
22c937 |
!
|
|
|
22c937 |
! #ifdef USE_CR
|
|
|
22c937 |
! /* translate <CR> into <NL> */
|
|
|
22c937 |
! if (res != NULL)
|
|
|
22c937 |
{
|
|
|
22c937 |
! char_u *s;
|
|
|
22c937 |
|
|
|
22c937 |
! for (s = res; *s; ++s)
|
|
|
22c937 |
! {
|
|
|
22c937 |
! if (*s == CAR)
|
|
|
22c937 |
! *s = NL;
|
|
|
22c937 |
}
|
|
|
22c937 |
}
|
|
|
22c937 |
! #else
|
|
|
22c937 |
! # ifdef USE_CRNL
|
|
|
22c937 |
! /* translate <CR><NL> into <NL> */
|
|
|
22c937 |
! if (res != NULL)
|
|
|
22c937 |
{
|
|
|
22c937 |
! char_u *s, *d;
|
|
|
22c937 |
|
|
|
22c937 |
! d = res;
|
|
|
22c937 |
! for (s = res; *s; ++s)
|
|
|
22c937 |
{
|
|
|
22c937 |
! if (s[0] == CAR && s[1] == NL)
|
|
|
22c937 |
! ++s;
|
|
|
22c937 |
! *d++ = *s;
|
|
|
22c937 |
}
|
|
|
22c937 |
- *d = NUL;
|
|
|
22c937 |
- }
|
|
|
22c937 |
# endif
|
|
|
22c937 |
#endif
|
|
|
22c937 |
|
|
|
22c937 |
! done:
|
|
|
22c937 |
if (infile != NULL)
|
|
|
22c937 |
{
|
|
|
22c937 |
mch_remove(infile);
|
|
|
22c937 |
vim_free(infile);
|
|
|
22c937 |
}
|
|
|
22c937 |
! rettv->v_type = VAR_STRING;
|
|
|
22c937 |
! rettv->vval.v_string = res;
|
|
|
22c937 |
}
|
|
|
22c937 |
|
|
|
22c937 |
/*
|
|
|
22c937 |
--- 18293,18420 ----
|
|
|
22c937 |
if (err)
|
|
|
22c937 |
{
|
|
|
22c937 |
EMSG(_("E677: Error writing temp file"));
|
|
|
22c937 |
! goto errret;
|
|
|
22c937 |
}
|
|
|
22c937 |
}
|
|
|
22c937 |
|
|
|
22c937 |
! if (retlist)
|
|
|
22c937 |
{
|
|
|
22c937 |
! int len;
|
|
|
22c937 |
! listitem_T *li;
|
|
|
22c937 |
! char_u *s = NULL;
|
|
|
22c937 |
! char_u *start;
|
|
|
22c937 |
! char_u *end;
|
|
|
22c937 |
! char_u *p;
|
|
|
22c937 |
! int i;
|
|
|
22c937 |
!
|
|
|
22c937 |
! res = get_cmd_output(get_tv_string(&argvars[0]), infile,
|
|
|
22c937 |
! SHELL_SILENT | SHELL_COOKED, &len;;
|
|
|
22c937 |
! if (res == NULL)
|
|
|
22c937 |
! goto errret;
|
|
|
22c937 |
!
|
|
|
22c937 |
! list = list_alloc();
|
|
|
22c937 |
! if (list == NULL)
|
|
|
22c937 |
! goto errret;
|
|
|
22c937 |
!
|
|
|
22c937 |
! for (i = 0; i < len; ++i)
|
|
|
22c937 |
! {
|
|
|
22c937 |
! start = res + i;
|
|
|
22c937 |
! for (end = start; i < len && *end != NL; ++end)
|
|
|
22c937 |
! ++i;
|
|
|
22c937 |
|
|
|
22c937 |
! s = vim_strnsave(start, (int)(end - start));
|
|
|
22c937 |
! if (s == NULL)
|
|
|
22c937 |
! goto errret;
|
|
|
22c937 |
!
|
|
|
22c937 |
! for (p = s, end = s + (end - start); p < end; ++p)
|
|
|
22c937 |
! if (*p == NUL)
|
|
|
22c937 |
! *p = NL;
|
|
|
22c937 |
!
|
|
|
22c937 |
! li = listitem_alloc();
|
|
|
22c937 |
! if (li == NULL)
|
|
|
22c937 |
! {
|
|
|
22c937 |
! vim_free(s);
|
|
|
22c937 |
! goto errret;
|
|
|
22c937 |
! }
|
|
|
22c937 |
! li->li_tv.v_type = VAR_STRING;
|
|
|
22c937 |
! li->li_tv.vval.v_string = s;
|
|
|
22c937 |
! list_append(list, li);
|
|
|
22c937 |
}
|
|
|
22c937 |
+
|
|
|
22c937 |
+ rettv->v_type = VAR_LIST;
|
|
|
22c937 |
+ rettv->vval.v_list = list;
|
|
|
22c937 |
+ list = NULL;
|
|
|
22c937 |
}
|
|
|
22c937 |
! else
|
|
|
22c937 |
{
|
|
|
22c937 |
! res = get_cmd_output(get_tv_string(&argvars[0]), infile,
|
|
|
22c937 |
! SHELL_SILENT | SHELL_COOKED, NULL);
|
|
|
22c937 |
! #ifdef USE_CR
|
|
|
22c937 |
! /* translate <CR> into <NL> */
|
|
|
22c937 |
! if (res != NULL)
|
|
|
22c937 |
! {
|
|
|
22c937 |
! char_u *s;
|
|
|
22c937 |
|
|
|
22c937 |
! for (s = res; *s; ++s)
|
|
|
22c937 |
! {
|
|
|
22c937 |
! if (*s == CAR)
|
|
|
22c937 |
! *s = NL;
|
|
|
22c937 |
! }
|
|
|
22c937 |
! }
|
|
|
22c937 |
! #else
|
|
|
22c937 |
! # ifdef USE_CRNL
|
|
|
22c937 |
! /* translate <CR><NL> into <NL> */
|
|
|
22c937 |
! if (res != NULL)
|
|
|
22c937 |
{
|
|
|
22c937 |
! char_u *s, *d;
|
|
|
22c937 |
!
|
|
|
22c937 |
! d = res;
|
|
|
22c937 |
! for (s = res; *s; ++s)
|
|
|
22c937 |
! {
|
|
|
22c937 |
! if (s[0] == CAR && s[1] == NL)
|
|
|
22c937 |
! ++s;
|
|
|
22c937 |
! *d++ = *s;
|
|
|
22c937 |
! }
|
|
|
22c937 |
! *d = NUL;
|
|
|
22c937 |
}
|
|
|
22c937 |
# endif
|
|
|
22c937 |
#endif
|
|
|
22c937 |
+ rettv->vval.v_string = res;
|
|
|
22c937 |
+ res = NULL;
|
|
|
22c937 |
+ }
|
|
|
22c937 |
|
|
|
22c937 |
! errret:
|
|
|
22c937 |
if (infile != NULL)
|
|
|
22c937 |
{
|
|
|
22c937 |
mch_remove(infile);
|
|
|
22c937 |
vim_free(infile);
|
|
|
22c937 |
}
|
|
|
22c937 |
! if (res != NULL)
|
|
|
22c937 |
! vim_free(res);
|
|
|
22c937 |
! if (list != NULL)
|
|
|
22c937 |
! list_free(list, TRUE);
|
|
|
22c937 |
! }
|
|
|
22c937 |
!
|
|
|
22c937 |
! /*
|
|
|
22c937 |
! * "system()" function
|
|
|
22c937 |
! */
|
|
|
22c937 |
! static void
|
|
|
22c937 |
! f_system(argvars, rettv)
|
|
|
22c937 |
! typval_T *argvars;
|
|
|
22c937 |
! typval_T *rettv;
|
|
|
22c937 |
! {
|
|
|
22c937 |
! get_cmd_output_as_rettv(argvars, rettv, FALSE);
|
|
|
22c937 |
! }
|
|
|
22c937 |
!
|
|
|
22c937 |
! /*
|
|
|
22c937 |
! * "systemlist()" function
|
|
|
22c937 |
! */
|
|
|
22c937 |
! static void
|
|
|
22c937 |
! f_systemlist(argvars, rettv)
|
|
|
22c937 |
! typval_T *argvars;
|
|
|
22c937 |
! typval_T *rettv;
|
|
|
22c937 |
! {
|
|
|
22c937 |
! get_cmd_output_as_rettv(argvars, rettv, TRUE);
|
|
|
22c937 |
}
|
|
|
22c937 |
|
|
|
22c937 |
/*
|
|
|
22c937 |
*** ../vim-7.4.247/src/ex_cmds2.c 2013-11-09 03:31:45.000000000 +0100
|
|
|
22c937 |
--- src/ex_cmds2.c 2014-04-05 19:20:25.023157552 +0200
|
|
|
22c937 |
***************
|
|
|
22c937 |
*** 4341,4347 ****
|
|
|
22c937 |
/* Find all available locales by running command "locale -a". If this
|
|
|
22c937 |
* doesn't work we won't have completion. */
|
|
|
22c937 |
char_u *locale_a = get_cmd_output((char_u *)"locale -a",
|
|
|
22c937 |
! NULL, SHELL_SILENT);
|
|
|
22c937 |
if (locale_a == NULL)
|
|
|
22c937 |
return NULL;
|
|
|
22c937 |
ga_init2(&locales_ga, sizeof(char_u *), 20);
|
|
|
22c937 |
--- 4341,4347 ----
|
|
|
22c937 |
/* Find all available locales by running command "locale -a". If this
|
|
|
22c937 |
* doesn't work we won't have completion. */
|
|
|
22c937 |
char_u *locale_a = get_cmd_output((char_u *)"locale -a",
|
|
|
22c937 |
! NULL, SHELL_SILENT, NULL);
|
|
|
22c937 |
if (locale_a == NULL)
|
|
|
22c937 |
return NULL;
|
|
|
22c937 |
ga_init2(&locales_ga, sizeof(char_u *), 20);
|
|
|
22c937 |
*** ../vim-7.4.247/src/misc1.c 2014-04-01 21:00:45.436733663 +0200
|
|
|
22c937 |
--- src/misc1.c 2014-04-05 19:21:36.603157708 +0200
|
|
|
22c937 |
***************
|
|
|
22c937 |
*** 10665,10671 ****
|
|
|
22c937 |
else
|
|
|
22c937 |
#endif
|
|
|
22c937 |
buffer = get_cmd_output(cmd, NULL,
|
|
|
22c937 |
! (flags & EW_SILENT) ? SHELL_SILENT : 0);
|
|
|
22c937 |
vim_free(cmd);
|
|
|
22c937 |
if (buffer == NULL)
|
|
|
22c937 |
return 0;
|
|
|
22c937 |
--- 10665,10671 ----
|
|
|
22c937 |
else
|
|
|
22c937 |
#endif
|
|
|
22c937 |
buffer = get_cmd_output(cmd, NULL,
|
|
|
22c937 |
! (flags & EW_SILENT) ? SHELL_SILENT : 0, NULL);
|
|
|
22c937 |
vim_free(cmd);
|
|
|
22c937 |
if (buffer == NULL)
|
|
|
22c937 |
return 0;
|
|
|
22c937 |
***************
|
|
|
22c937 |
*** 10765,10777 ****
|
|
|
22c937 |
|
|
|
22c937 |
/*
|
|
|
22c937 |
* Get the stdout of an external command.
|
|
|
22c937 |
* Returns an allocated string, or NULL for error.
|
|
|
22c937 |
*/
|
|
|
22c937 |
char_u *
|
|
|
22c937 |
! get_cmd_output(cmd, infile, flags)
|
|
|
22c937 |
char_u *cmd;
|
|
|
22c937 |
char_u *infile; /* optional input file name */
|
|
|
22c937 |
int flags; /* can be SHELL_SILENT */
|
|
|
22c937 |
{
|
|
|
22c937 |
char_u *tempname;
|
|
|
22c937 |
char_u *command;
|
|
|
22c937 |
--- 10765,10780 ----
|
|
|
22c937 |
|
|
|
22c937 |
/*
|
|
|
22c937 |
* Get the stdout of an external command.
|
|
|
22c937 |
+ * If "ret_len" is NULL replace NUL characters with NL. When "ret_len" is not
|
|
|
22c937 |
+ * NULL store the length there.
|
|
|
22c937 |
* Returns an allocated string, or NULL for error.
|
|
|
22c937 |
*/
|
|
|
22c937 |
char_u *
|
|
|
22c937 |
! get_cmd_output(cmd, infile, flags, ret_len)
|
|
|
22c937 |
char_u *cmd;
|
|
|
22c937 |
char_u *infile; /* optional input file name */
|
|
|
22c937 |
int flags; /* can be SHELL_SILENT */
|
|
|
22c937 |
+ int *ret_len;
|
|
|
22c937 |
{
|
|
|
22c937 |
char_u *tempname;
|
|
|
22c937 |
char_u *command;
|
|
|
22c937 |
***************
|
|
|
22c937 |
*** 10841,10847 ****
|
|
|
22c937 |
vim_free(buffer);
|
|
|
22c937 |
buffer = NULL;
|
|
|
22c937 |
}
|
|
|
22c937 |
! else
|
|
|
22c937 |
{
|
|
|
22c937 |
/* Change NUL into SOH, otherwise the string is truncated. */
|
|
|
22c937 |
for (i = 0; i < len; ++i)
|
|
|
22c937 |
--- 10844,10850 ----
|
|
|
22c937 |
vim_free(buffer);
|
|
|
22c937 |
buffer = NULL;
|
|
|
22c937 |
}
|
|
|
22c937 |
! else if (ret_len == NULL)
|
|
|
22c937 |
{
|
|
|
22c937 |
/* Change NUL into SOH, otherwise the string is truncated. */
|
|
|
22c937 |
for (i = 0; i < len; ++i)
|
|
|
22c937 |
***************
|
|
|
22c937 |
*** 10850,10855 ****
|
|
|
22c937 |
--- 10853,10860 ----
|
|
|
22c937 |
|
|
|
22c937 |
buffer[len] = NUL; /* make sure the buffer is terminated */
|
|
|
22c937 |
}
|
|
|
22c937 |
+ else
|
|
|
22c937 |
+ *ret_len = len;
|
|
|
22c937 |
|
|
|
22c937 |
done:
|
|
|
22c937 |
vim_free(tempname);
|
|
|
22c937 |
*** ../vim-7.4.247/src/proto/misc1.pro 2013-11-06 04:01:31.000000000 +0100
|
|
|
22c937 |
--- src/proto/misc1.pro 2014-04-05 19:06:26.427155720 +0200
|
|
|
22c937 |
***************
|
|
|
22c937 |
*** 100,106 ****
|
|
|
22c937 |
void remove_duplicates __ARGS((garray_T *gap));
|
|
|
22c937 |
int gen_expand_wildcards __ARGS((int num_pat, char_u **pat, int *num_file, char_u ***file, int flags));
|
|
|
22c937 |
void addfile __ARGS((garray_T *gap, char_u *f, int flags));
|
|
|
22c937 |
! char_u *get_cmd_output __ARGS((char_u *cmd, char_u *infile, int flags));
|
|
|
22c937 |
void FreeWild __ARGS((int count, char_u **files));
|
|
|
22c937 |
int goto_im __ARGS((void));
|
|
|
22c937 |
/* vim: set ft=c : */
|
|
|
22c937 |
--- 100,106 ----
|
|
|
22c937 |
void remove_duplicates __ARGS((garray_T *gap));
|
|
|
22c937 |
int gen_expand_wildcards __ARGS((int num_pat, char_u **pat, int *num_file, char_u ***file, int flags));
|
|
|
22c937 |
void addfile __ARGS((garray_T *gap, char_u *f, int flags));
|
|
|
22c937 |
! char_u *get_cmd_output __ARGS((char_u *cmd, char_u *infile, int flags, int *ret_len));
|
|
|
22c937 |
void FreeWild __ARGS((int count, char_u **files));
|
|
|
22c937 |
int goto_im __ARGS((void));
|
|
|
22c937 |
/* vim: set ft=c : */
|
|
|
22c937 |
*** ../vim-7.4.247/src/version.c 2014-04-05 18:55:40.479154309 +0200
|
|
|
22c937 |
--- src/version.c 2014-04-05 19:07:12.447155821 +0200
|
|
|
22c937 |
***************
|
|
|
22c937 |
*** 736,737 ****
|
|
|
22c937 |
--- 736,739 ----
|
|
|
22c937 |
{ /* Add new patch number below this line */
|
|
|
22c937 |
+ /**/
|
|
|
22c937 |
+ 248,
|
|
|
22c937 |
/**/
|
|
|
22c937 |
|
|
|
22c937 |
--
|
|
|
22c937 |
Tips for aliens in New York: Land anywhere. Central Park, anywhere.
|
|
|
22c937 |
No one will care or indeed even notice.
|
|
|
22c937 |
-- Douglas Adams, "The Hitchhiker's Guide to the Galaxy"
|
|
|
22c937 |
|
|
|
22c937 |
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
|
|
|
22c937 |
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
|
|
|
22c937 |
\\\ an exciting new programming language -- http://www.Zimbu.org ///
|
|
|
22c937 |
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|