X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;ds=inline;f=nt%2Fminitar.c;h=a903c6d84b26f238bb63cac8769690db63c6295a;hb=8b90607bbf78f11736d869b99d81da8567dcf2fd;hp=75127f6c6fda1fe4516d38f7708e7ef6f190f12e;hpb=46f51e794ddb493a8a76ec2f3be00b41e3b0be22;p=chise%2Fxemacs-chise.git- diff --git a/nt/minitar.c b/nt/minitar.c index 75127f6..a903c6d 100644 --- a/nt/minitar.c +++ b/nt/minitar.c @@ -13,10 +13,13 @@ #include -#include +#include +#include +#include #include +static int Usage(char *name) { fprintf(stderr,"Usage: %s file.tar.gz [base-dir]\n",name); @@ -28,7 +31,8 @@ Usage(char *name) #define BLOCKSIZE 512 #define MAXNAMELEN 1024 -int octal(char *str) +static int +octal(char *str) { int ret = -1; sscanf(str,"%o",&ret); @@ -39,11 +43,11 @@ int octal(char *str) the final component is assumed to be a file, rather than a path component, so it is not created as a directory */ -int makepath(char *path) +static int +makepath(char *path) { char tmp[MAXNAMELEN]; char *cp; - extern int errno; for (cp=path; cp; cp = (char*)strchr(cp+1,'/')){ if (!*cp) @@ -54,7 +58,11 @@ int makepath(char *path) tmp[cp-path] = '\0'; if (strlen(tmp) == 0) continue; +#ifdef WIN32_NATIVE + if (mkdir(tmp)){ +#else if (mkdir(tmp,0777)){ +#endif if (errno == EEXIST) continue; else @@ -67,12 +75,12 @@ int makepath(char *path) +int main(int argc, char **argv) { char fullname[MAXNAMELEN]; char *basedir = "."; char *tarfile; - char *cp; int size; char osize[13]; char name[101];