[hackers] [sltar] preparing sltar for creating tars. || gottox
changeset: 26:8e03adc56a1d
user: gottox_AT_rootkit.lan
date: Sun Feb 10 12:24:10 2008 +0100
files: sltar.c
description:
preparing sltar for creating tars.
diff -r ca4097dabe13 -r 8e03adc56a1d sltar.c
--- a/sltar.c Mon Jan 14 20:12:40 2008 +0100
+++ b/sltar.c Sun Feb 10 12:24:10 2008 +0100
_AT_@ -13,17 +13,15 @@
MODE = 100, UID = 108, GID = 116, SIZE = 124, MTIME = 136,
TYPE = 156, LINK = 157, MAJ = 329, MIN = 337, END = 512
};
+int c() {
+ fputs("Creating tars does not work yet\n", stderr);
+ return EXIT_FAILURE;
+}
+int xt(char a) {
+ int l;
+ char b[END],fname[101],lname[101];
+ FILE *f = NULL;
-int main(int argc, char *argv[]) {
- int a, l;
- char b[END],fname[101],lname[101];
- FILE *f = 0;
-
- if((argc != 2 || (a = argv[1][0]) == '\0') ||
- argv[1][1] != '\0' || (a != 't' && a != 'x')) {
- fputs("sltar-" VERSION " - suckless tar\nsltar [xt]\n",stderr);
- return EXIT_FAILURE;
- }
for(lname[100] = fname[100] = l = 0; fread(b,END,1,stdin); l -= END)
if(l <= 0) {
if(*b == '\0')
_AT_@ -82,3 +80,20 @@
fclose(f);
return EXIT_SUCCESS;
}
+
+int main(int argc, char *argv[]) {
+ char a = 0;
+
+ if(argc == 2 && argv[1][0] != 0 && argv[1][1] == 0)
+ a = argv[1][0];
+ switch(a) {
+ case 'c':
+ return c();
+ case 'x':
+ case 't':
+ return xt(a);
+ default:
+ fputs("sltar-" VERSION " - suckless tar\nsltar [ctx]\n",stderr);
+ return EXIT_SUCCESS;
+ }
+}
Received on Sun Nov 11 2012 - 17:23:52 CET
This archive was generated by hypermail 2.3.0
: Sun Nov 11 2012 - 17:24:47 CET