projects
/
chise
/
xemacs-chise.git-
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
(JX1-7763): Unify JU+7215.
[chise/xemacs-chise.git-]
/
nt
/
minitar.c
diff --git
a/nt/minitar.c
b/nt/minitar.c
index
75127f6
..
a704d5f
100644
(file)
--- a/
nt/minitar.c
+++ b/
nt/minitar.c
@@
-13,10
+13,17
@@
#include <stdio.h>
#include <stdio.h>
-#include <Errno.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <string.h>
+#include <io.h>
+#ifdef WIN32_NATIVE
+# include <direct.h> /* For mkdir */
+#endif
#include <zlib.h>
#include <zlib.h>
+static int
Usage(char *name)
{
fprintf(stderr,"Usage: %s file.tar.gz [base-dir]\n",name);
Usage(char *name)
{
fprintf(stderr,"Usage: %s file.tar.gz [base-dir]\n",name);
@@
-28,7
+35,8
@@
Usage(char *name)
#define BLOCKSIZE 512
#define MAXNAMELEN 1024
#define BLOCKSIZE 512
#define MAXNAMELEN 1024
-int octal(char *str)
+static int
+octal(char *str)
{
int ret = -1;
sscanf(str,"%o",&ret);
{
int ret = -1;
sscanf(str,"%o",&ret);
@@
-39,11
+47,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 */
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;
{
char tmp[MAXNAMELEN];
char *cp;
- extern int errno;
for (cp=path; cp; cp = (char*)strchr(cp+1,'/')){
if (!*cp)
for (cp=path; cp; cp = (char*)strchr(cp+1,'/')){
if (!*cp)
@@
-54,7
+62,11
@@
int makepath(char *path)
tmp[cp-path] = '\0';
if (strlen(tmp) == 0)
continue;
tmp[cp-path] = '\0';
if (strlen(tmp) == 0)
continue;
+#ifdef WIN32_NATIVE
+ if (mkdir(tmp)){
+#else
if (mkdir(tmp,0777)){
if (mkdir(tmp,0777)){
+#endif
if (errno == EEXIST)
continue;
else
if (errno == EEXIST)
continue;
else
@@
-67,12
+79,12
@@
int makepath(char *path)
+int
main(int argc, char **argv)
{
char fullname[MAXNAMELEN];
char *basedir = ".";
char *tarfile;
main(int argc, char **argv)
{
char fullname[MAXNAMELEN];
char *basedir = ".";
char *tarfile;
- char *cp;
int size;
char osize[13];
char name[101];
int size;
char osize[13];
char name[101];