make echo better
This commit is contained in:
+2
-3
@@ -1,16 +1,15 @@
|
||||
#include <sysexits.h>
|
||||
#include <stddef.h> /* NULL */
|
||||
#include <unistd.h> /* write(2) */
|
||||
#include "libio.h" /* fdprint(3) */
|
||||
|
||||
int main(int argc, char **argv){
|
||||
int s;
|
||||
|
||||
if(*argv == NULL)
|
||||
return EX_OSERR;
|
||||
|
||||
while(*++argv != NULL){
|
||||
for(s = 0; *(*argv+s) != '\0'; ++s);
|
||||
write(1, *argv, s);
|
||||
fdprint(1, *argv);
|
||||
|
||||
if(*(argv+1) != NULL)
|
||||
write(1, " ", 1);
|
||||
|
||||
Reference in New Issue
Block a user