comparison src/misc1.c @ 24:8ff7fd162d3c v7.0016

updated for version 7.0016
author vimboss
date Mon, 13 Sep 2004 20:26:32 +0000
parents cc049b00ee70
children 125e80798a85
comparison
equal deleted inserted replaced
23:3f44e9abe4ec 24:8ff7fd162d3c
8350 #ifdef FEAT_EVAL 8350 #ifdef FEAT_EVAL
8351 if (*cmd == '=') /* `={expr}`: Expand expression */ 8351 if (*cmd == '=') /* `={expr}`: Expand expression */
8352 buffer = eval_to_string(cmd + 1, &p); 8352 buffer = eval_to_string(cmd + 1, &p);
8353 else 8353 else
8354 #endif 8354 #endif
8355 buffer = get_cmd_output(cmd, (flags & EW_SILENT) ? SHELL_SILENT : 0); 8355 buffer = get_cmd_output(cmd, NULL,
8356 (flags & EW_SILENT) ? SHELL_SILENT : 0);
8356 vim_free(cmd); 8357 vim_free(cmd);
8357 if (buffer == NULL) 8358 if (buffer == NULL)
8358 return 0; 8359 return 0;
8359 8360
8360 cmd = buffer; 8361 cmd = buffer;
8449 /* 8450 /*
8450 * Get the stdout of an external command. 8451 * Get the stdout of an external command.
8451 * Returns an allocated string, or NULL for error. 8452 * Returns an allocated string, or NULL for error.
8452 */ 8453 */
8453 char_u * 8454 char_u *
8454 get_cmd_output(cmd, flags) 8455 get_cmd_output(cmd, infile, flags)
8455 char_u *cmd; 8456 char_u *cmd;
8457 char_u *infile; /* optional input file name */
8456 int flags; /* can be SHELL_SILENT */ 8458 int flags; /* can be SHELL_SILENT */
8457 { 8459 {
8458 char_u *tempname; 8460 char_u *tempname;
8459 char_u *command; 8461 char_u *command;
8460 char_u *buffer = NULL; 8462 char_u *buffer = NULL;
8471 EMSG(_(e_notmp)); 8473 EMSG(_(e_notmp));
8472 return NULL; 8474 return NULL;
8473 } 8475 }
8474 8476
8475 /* Add the redirection stuff */ 8477 /* Add the redirection stuff */
8476 command = make_filter_cmd(cmd, NULL, tempname); 8478 command = make_filter_cmd(cmd, infile, tempname);
8477 if (command == NULL) 8479 if (command == NULL)
8478 goto done; 8480 goto done;
8479 8481
8480 /* 8482 /*
8481 * Call the shell to execute the command (errors are ignored). 8483 * Call the shell to execute the command (errors are ignored).