X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fcreate.c;h=0bf8a70733d483c20d8a593553a2e5038b45dc5f;hb=72e7c861e33d61f3ed71e07ef9ba3b43d97441d2;hp=acc6c1a53d34c7940350ddf1afe67c75837de032;hpb=3c3096d9d5fd695e2eb4c1179cfc0b3a14238876;p=chaz%2Ftar diff --git a/src/create.c b/src/create.c index acc6c1a..0bf8a70 100644 --- a/src/create.c +++ b/src/create.c @@ -60,28 +60,6 @@ struct utimbuf #endif -#if defined(_POSIX_VERSION) || defined(DIRENT) -#include -#ifdef direct -#undef direct -#endif /* direct */ -#define direct dirent -#define DP_NAMELEN(x) strlen((x)->d_name) -#endif /* _POSIX_VERSION or DIRENT */ -#if !defined(_POSIX_VERSION) && !defined(DIRENT) && defined(BSD42) -#include -#define DP_NAMELEN(x) (x)->d_namlen -#endif /* not _POSIX_VERSION and BSD42 */ -#ifdef __MSDOS__ -#include "msd_dir.h" -#define DP_NAMELEN(x) (x)->d_namlen -#define direct dirent -#endif -#if defined(USG) && !defined(_POSIX_VERSION) && !defined(DIRENT) -#include -#define DP_NAMELEN(x) strlen((x)->d_name) -#endif /* USG and not _POSIX_VERSION and not DIRENT */ - extern struct stat hstat; /* Stat struct corresponding */ #ifndef __MSDOS__ @@ -124,6 +102,7 @@ void to_oct (); void dump_file (); void write_dir_file (); void write_eot (); +void write_long (); int zero_record (); /* This code moved from tar.h since create.c is the only file that cares @@ -685,7 +664,7 @@ dump_file (p, curdev, toplevel) else if (S_ISDIR (hstat.st_mode)) { register DIR *dirp; - register struct direct *d; + register struct dirent *d; char *namebuf; int buflen; register int len; @@ -830,9 +809,9 @@ dump_file (p, curdev, toplevel) if (is_dot_or_dotdot (d->d_name)) continue; - if (DP_NAMELEN (d) + len >= buflen) + if (NLENGTH (d) + len >= buflen) { - buflen = len + DP_NAMELEN (d); + buflen = len + NLENGTH (d); namebuf = ck_realloc (namebuf, buflen + 1); /* namebuf[len]='\0'; msg("file name %s%s too long", @@ -1435,6 +1414,7 @@ write_eot () } /* Write a LF_LONGLINK or LF_LONGNAME record. */ +void write_long (p, type) char *p; char type;