[hackers] [sbase] tar: Rename field to better match spec || sin
commit 74f680948e4cf1b4a5200c4b8774b7163d7bb7e1
Author: sin <sin_AT_2f30.org>
Date: Thu Apr 23 16:14:09 2015 +0100
tar: Rename field to better match spec
diff --git a/tar.c b/tar.c
index a7f3e45..d410b0f 100644
--- a/tar.c
+++ b/tar.c
_AT_@ -24,7 +24,7 @@ struct header {
char mtime[12];
char chksum[8];
char type;
- char link[100];
+ char linkname[100];
char magic[6];
char version[2];
char uname[32];
_AT_@ -186,9 +186,9 @@ archive(const char *path)
h->type = DIRECTORY;
} else if (S_ISLNK(st.st_mode)) {
h->type = SYMLINK;
- if ((r = readlink(path, h->link, sizeof(h->link) - 1)) < 0)
+ if ((r = readlink(path, h->linkname, sizeof(h->linkname) - 1)) < 0)
eprintf("readlink %s:", path);
- h->link[r] = '\0';
+ h->linkname[r] = '\0';
} else if (S_ISCHR(st.st_mode) || S_ISBLK(st.st_mode)) {
h->type = S_ISCHR(st.st_mode) ? CHARDEV : BLOCKDEV;
putoctal(h->major, (unsigned)major(st.st_dev), sizeof(h->major));
_AT_@ -245,8 +245,8 @@ unarchive(char *fname, ssize_t l, char b[BLKSIZ])
break;
case HARDLINK:
case SYMLINK:
- snprintf(lname, sizeof(lname), "%.*s", (int)sizeof(h->link),
- h->link);
+ snprintf(lname, sizeof(lname), "%.*s", (int)sizeof(h->linkname),
+ h->linkname);
if (((h->type == HARDLINK) ? link : symlink)(lname, fname) < 0)
eprintf("%s %s -> %s:",
(h->type == HARDLINK) ? "link" : "symlink",
Received on Thu Apr 23 2015 - 17:34:17 CEST
This archive was generated by hypermail 2.3.0
: Thu Apr 23 2015 - 17:36:17 CEST