summaryrefslogtreecommitdiffstats
path: root/Utilities
diff options
context:
space:
mode:
Diffstat (limited to 'Utilities')
-rw-r--r--Utilities/cmtar/CMakeLists.txt1
-rw-r--r--Utilities/cmtar/append.c5
-rw-r--r--Utilities/cmtar/compat/fnmatch.c7
-rw-r--r--Utilities/cmtar/config.h.in3
-rw-r--r--Utilities/cmtar/extract.c10
-rw-r--r--Utilities/cmtar/handle.c2
6 files changed, 20 insertions, 8 deletions
diff --git a/Utilities/cmtar/CMakeLists.txt b/Utilities/cmtar/CMakeLists.txt
index 3ef4100..1c3b470 100644
--- a/Utilities/cmtar/CMakeLists.txt
+++ b/Utilities/cmtar/CMakeLists.txt
@@ -67,6 +67,7 @@ FOREACH(file
"ctype.h"
"fnmatch.h"
"inttypes.h"
+ "io.h"
"libgen.h"
"memory.h"
"sys/mkdev.h"
diff --git a/Utilities/cmtar/append.c b/Utilities/cmtar/append.c
index 6b746ea..38e8294 100644
--- a/Utilities/cmtar/append.c
+++ b/Utilities/cmtar/append.c
@@ -31,8 +31,9 @@
#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
-#ifdef _MSC_VER
-#include <io.h>
+
+#ifdef HAVE_IO_H
+# include <io.h>
#endif
struct tar_dev
diff --git a/Utilities/cmtar/compat/fnmatch.c b/Utilities/cmtar/compat/fnmatch.c
index d10e8a3..936f21e 100644
--- a/Utilities/cmtar/compat/fnmatch.c
+++ b/Utilities/cmtar/compat/fnmatch.c
@@ -70,11 +70,7 @@ static char rcsid[] = "$OpenBSD: fnmatch.c,v 1.6 1998/03/19 00:29:59 millert Exp
#define RANGE_NOMATCH 0
#define RANGE_ERROR (-1)
-#ifdef NO_IBM_COMPILER_HORKAGE
static int rangematch (const char *, char, int, char **);
-#else
-static int rangematch ();
-#endif
int
fnmatch(pattern, string, flags)
@@ -195,7 +191,8 @@ rangematch(pattern, test, flags, newp)
* consistency with the regular expression syntax.
* J.T. Conklin (conklin@ngai.kaleida.com)
*/
- if ((negate = (*pattern == '!' || *pattern == '^')))
+ negate = (*pattern == '!' || *pattern == '^');
+ if (negate)
++pattern;
if (flags & FNM_CASEFOLD)
diff --git a/Utilities/cmtar/config.h.in b/Utilities/cmtar/config.h.in
index 948afde..1ab4362 100644
--- a/Utilities/cmtar/config.h.in
+++ b/Utilities/cmtar/config.h.in
@@ -30,6 +30,9 @@
/* Define to 1 if you have the <inttypes.h> header file. */
#cmakedefine HAVE_INTTYPES_H @HAVE_INTTYPES_H@
+/* Define to 1 if you have the <io.h> header file. */
+#cmakedefine HAVE_IO_H @HAVE_IO_H@
+
/* Define to 1 if you have the `lchown' function. */
#cmakedefine HAVE_LCHOWN @HAVE_LCHOWN@
diff --git a/Utilities/cmtar/extract.c b/Utilities/cmtar/extract.c
index 3ebdeeb..cb1fab3 100644
--- a/Utilities/cmtar/extract.c
+++ b/Utilities/cmtar/extract.c
@@ -470,11 +470,13 @@ tar_extract_hardlink(TAR * t, char *realname)
return -1;
}
+#ifndef WIN32
if (pathname)
{
free(pathname);
}
return 0;
+#endif
}
@@ -545,11 +547,13 @@ tar_extract_symlink(TAR *t, char *realname)
return -1;
}
+#ifndef WIN32
if (pathname)
{
free(pathname);
}
return 0;
+#endif
}
@@ -620,11 +624,13 @@ tar_extract_chardev(TAR *t, char *realname)
return -1;
}
+#ifndef WIN32
if (pathname)
{
free(pathname);
}
return 0;
+#endif
}
@@ -694,11 +700,13 @@ tar_extract_blockdev(TAR *t, char *realname)
return -1;
}
+#ifndef WIN32
if (pathname)
{
free(pathname);
}
return 0;
+#endif
}
@@ -867,9 +875,11 @@ tar_extract_fifo(TAR *t, char *realname)
return -1;
}
+#ifndef WIN32
if (pathname)
{
free(pathname);
}
return 0;
+#endif
}
diff --git a/Utilities/cmtar/handle.c b/Utilities/cmtar/handle.c
index 4f6dd10..a86bbc5 100644
--- a/Utilities/cmtar/handle.c
+++ b/Utilities/cmtar/handle.c
@@ -24,7 +24,7 @@
# include <stdlib.h>
#endif
-#if defined ( _MSC_VER) || defined(__WATCOMC__)
+#ifdef HAVE_IO_H
#include <io.h>
//Yogi: hack. this should work on windows where there is no O_ACCMODE defined
#ifndef O_ACCMODE