8000 minix/commands/elvis/ex.c at R3.1.1 · lukegithub/minix · GitHub
[go: up one dir, main page]

Skip to content

Navigation Menu

Latest commit

 

History

History
executable file
·
722 lines (657 loc) · 16 KB

ex.c

File metadata and controls

executable file
·
722 lines (657 loc) · 16 KB
char single[133]; /* a single command */
char *src, *dest;
int i;
/* find & do each command */
for (src = buf; src < &buf[len]; src++)
{
/* Copy a single command into single[]. Convert any quoted |
* into a normal |, and stop at a newline or unquoted |.
*/
for (dest = single, i = 0;
i < 132 && src < &buf[len] && *src != '\n' && *src != '|';
src++, i++)
{
if (src[0] == qchar && src[1] == '|')
{
src++;
}
*dest++ = *src;
}
*dest = '\0';
/* do it */
doexcmd(single);
}
}
0