independ
This commit is contained in:
parent
bc3b7c3f50
commit
bbd82d9290
11
echo/echo.c
11
echo/echo.c
@ -1,19 +1,20 @@
|
||||
#include <sysexits.h>
|
||||
#include <sysexits.h> /* EX_OK */
|
||||
#include <stddef.h> /* NULL */
|
||||
#include <unistd.h> /* write(2) */
|
||||
#include "libio.h" /* fdprint(3) */
|
||||
|
||||
int main(int argc, char **argv){
|
||||
int i;
|
||||
|
||||
if(*argv == NULL)
|
||||
return EX_OSERR;
|
||||
goto blank;
|
||||
|
||||
while(*++argv != NULL){
|
||||
fdprint(1, *argv);
|
||||
for(i = 0; argv[0][i] != '\0'; ++i);
|
||||
write(1, *argv, i);
|
||||
|
||||
if(*(argv+1) != NULL)
|
||||
write(1, " ", 1);
|
||||
}
|
||||
write(1, "\n", 1);
|
||||
blank: write(1, "\n", 1);
|
||||
return EX_OK;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user