Skip to content
This repository has been archived by the owner on Nov 21, 2020. It is now read-only.

Commit

Permalink
Tar formatted size reporting
Browse files Browse the repository at this point in the history
  • Loading branch information
dd86k committed Apr 14, 2018
1 parent ca8dd76 commit d1e8070
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/archives/tar.c
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
#include <stdio.h>
#include <stdlib.h>
#include "../utils.h"
#include "../settings.h"
#include "../ff.h"
#include "tar.h"
#include <stdio.h>

void scan_tar() {
struct tar_hdr h;
_ddseek(0, SEEK_SET);
_ddread(&h, sizeof(h));

long s = strtol(h.size, NULL, sizeof(h.size));

switch (h.linkflag) {
case 0:
case '0': reportn("Normal"); break;
Expand All @@ -19,10 +22,12 @@ void scan_tar() {
case '5': reportn("Directory"); break;
case '6': reportn("FIFO special"); break;
case '7': reportn("Contiguous"); break;
default: puts(""); return;
default: report("Unknown Tar archive"); return;
}

printf(" Tar archive of %s bytes\n", h.size);
printl(" Tar archive of ");
_printfd(s);
puts("");

if (More) {
printf(
Expand Down

0 comments on commit d1e8070

Please # to comment.