sltar

a simple tar implementation
git clone git://git.suckless.org/sltar
Log | Files | Refs | LICENSE

commit 04d5e4ffad8b43fe476a0b6e8d2fbae627f14c9b
parent 936d41a3c62a6e644002499b2cc6df9225e0f88b
Author: gottox@rootkit.lan <unknown>
Date:   Wed, 19 Dec 2007 10:47:24 +0100

USAGE macro is useless, removed.
Diffstat:
Makefile | 2+-
sltar.c | 10+++++-----
2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/Makefile b/Makefile @@ -1,4 +1,4 @@ -# sltar - a minimal implementation of tar +# sltar - suckless tar # (c) 2007 Enno Boland include config.mk diff --git a/sltar.c b/sltar.c @@ -1,4 +1,4 @@ -/* cmarkdown +/* sltar - suckless tar * Copyright (C) <2007> Enno boland <g s01 de> * * See LICENSE for further informations @@ -9,8 +9,6 @@ #include <string.h> #include <sys/stat.h> -#define USAGE { puts("tar [xt]"); exit(EXIT_FAILURE); } - enum Header { MODE = 100, UID = 108, GID = 116, SIZE = 124, MTIME = 136, TYPE = 156, LINK = 157, DEVMAJOR = 329, DEVMINOR = 337, @@ -23,8 +21,10 @@ int main(int argc, char *argv[]) { FILE *f; if((argc != 2 || (a = argv[1][0]) == '\0') || - argv[1][1] != '\0' || (a != 't' && a != 'x')) - USAGE; + argv[1][1] != '\0' || (a != 't' && a != 'x')) { + puts("sltar-" VERSION " - suckless tar\nsltar [xt]"); + exit(EXIT_FAILURE); + } lname[100] = fname[100] = '\0'; for(l = 0, f = NULL; fread(b,END,1,stdin); l -= END) { if(l <= 0) {