File src/commands.c changed (mode: 100644) (index f0c8738be..22e4a05dd) |
31 |
31 |
#include <sys/wait.h> |
#include <sys/wait.h> |
32 |
32 |
#endif |
#endif |
33 |
33 |
|
|
34 |
|
#include <assert.h> |
|
|
34 |
|
#include <assert.h> /* assert() */ |
35 |
35 |
#include <ctype.h> /* isspace() */ |
#include <ctype.h> /* isspace() */ |
36 |
36 |
#include <limits.h> /* PATH_MAX */ |
#include <limits.h> /* PATH_MAX */ |
37 |
37 |
#include <signal.h> |
#include <signal.h> |
|
... |
... |
echo_cmd(const cmd_info_t *cmd_info) |
1843 |
1843 |
return 1; |
return 1; |
1844 |
1844 |
} |
} |
1845 |
1845 |
|
|
1846 |
|
/* Evaluates :echo result for arguments. Returns pointer to newly allocated |
|
1847 |
|
* string, which should be freed by caller, or NULL on error. stop_ptr will |
|
1848 |
|
* point to the beginning of invalid expression in case of error. */ |
|
|
1846 |
|
/* Evaluates :echo result for arguments. args can not be empty string. Returns |
|
1847 |
|
* pointer to newly allocated string, which should be freed by caller, or NULL |
|
1848 |
|
* on error. stop_ptr will point to the beginning of invalid expression in case |
|
1849 |
|
* of error. */ |
1849 |
1850 |
TSTATIC char * |
TSTATIC char * |
1850 |
1851 |
eval_echo(const char args[], const char **stop_ptr) |
eval_echo(const char args[], const char **stop_ptr) |
1851 |
1852 |
{ |
{ |
1852 |
1853 |
size_t len = 0; |
size_t len = 0; |
1853 |
1854 |
char *eval_result = NULL; |
char *eval_result = NULL; |
1854 |
1855 |
|
|
|
1856 |
|
assert(args[0] != '\0'); |
|
1857 |
|
|
1855 |
1858 |
while(args[0] != '\0') |
while(args[0] != '\0') |
1856 |
1859 |
{ |
{ |
1857 |
1860 |
var_t result = var_false(); |
var_t result = var_false(); |