aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorqorg11 <qorg@vxempire.xyz>2020-11-30 11:33:42 +0100
committerqorg11 <qorg@vxempire.xyz>2020-11-30 11:33:42 +0100
commitdd949baf1c3400127ec003fb6cbe88016f2863c6 (patch)
treed30e3e7972033fa1d0b618e173483de37a6b0323
parent34a3f381adc8e6b06cdfec60b1db13cf2b707ae6 (diff)
downloadk9core-dd949baf1c3400127ec003fb6cbe88016f2863c6.tar.gz
k9core-dd949baf1c3400127ec003fb6cbe88016f2863c6.zip
Tabs instead of spaces in indentation lol
-rw-r--r--src/cat.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/cat.c b/src/cat.c
index d296d6b..9196575 100644
--- a/src/cat.c
+++ b/src/cat.c
@@ -8,31 +8,31 @@
int
cat(int fd, const char *filename)
{
- int c;
- char buf[8192];
- if (filename[0] == '-' && filename[1] != 'u')
- fd = 0;
-
- if(fd != 0)
- fd = open(filename, O_RDONLY);
+ int c;
+ char buf[8192];
+ if (filename[0] == '-' && filename[1] != 'u')
+ fd = 0;
- if (fd == -1)
- fprintf(stderr,"error opening %s: %s\n",filename,strerror(errno));
+ if(fd != 0)
+ fd = open(filename, O_RDONLY);
+ if (fd == -1)
+ fprintf(stderr,"error opening %s: %s\n",filename,strerror(errno));
- while((c = read(fd,buf,sizeof(buf))) > 0)
- write(1,buf,c);
- close(fd);
- return 0;
+
+ while((c = read(fd,buf,sizeof(buf))) > 0)
+ write(1,buf,c);
+ close(fd);
+ return 0;
}
int
main(int argc, char *argv[])
{
- int c = getopt(argc,argv,"u");
- if (argc == optind)
- cat(0,"-");
- for(int i = optind; i<argc;i++)
- cat(1,argv[i]);
+ int c = getopt(argc,argv,"u");
+ if (argc == optind)
+ cat(0,"-");
+ for(int i = optind; i<argc;i++)
+ cat(1,argv[i]);
- return 0;
+ return 0;
}