* '|' at the beggining of command is an io pipe instead of console pipe

* r_line uses ansi code to clean line instead of drawing spaces
This commit is contained in:
pancake 2010-08-23 19:13:19 +02:00
parent 895d947f49
commit 3edaed0067
2 changed files with 8 additions and 1 deletions

View File

@ -3006,7 +3006,9 @@ static int r_core_cmd_subst(RCore *core, char *cmd) {
ptr = strchr (cmd, '|');
if (ptr) {
ptr[0] = '\0';
r_core_cmd_pipe (core, cmd, ptr+1);
cmd = r_str_clean (cmd);
if (*cmd) r_core_cmd_pipe (core, cmd, ptr+1);
else r_io_system (core->io, ptr+1);
return 0;
}

View File

@ -267,8 +267,13 @@ R_API char *r_line_readline() {
columns = r_cons_get_size (NULL)-2;
if (columns<1)
columns = 40;
#if __WINDOWS__
if (I.echo)
printf ("\r%*c\r", columns, ' ');
#else
if (I.echo)
printf ("\r\x1b[2K\r"); //%*c\r", columns, ' ');
#endif
switch (buf[0]) {
//case -1: // ^D