@@ -3,6 +3,8 @@
|
|||||||
branches:
|
branches:
|
||||||
only:
|
only:
|
||||||
- master
|
- master
|
||||||
|
- appveyorTest
|
||||||
|
- /visual*/
|
||||||
environment:
|
environment:
|
||||||
matrix:
|
matrix:
|
||||||
- COMPILER: "gcc"
|
- COMPILER: "gcc"
|
||||||
|
|||||||
@@ -397,7 +397,7 @@
|
|||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\..\programs\bench.c"
|
RelativePath="..\..\..\programs\benchfn.c"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
@@ -405,7 +405,7 @@
|
|||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\..\tests\util.c"
|
RelativePath="..\..\..\programs\util.c"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
|
|||||||
@@ -337,7 +337,11 @@
|
|||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\..\programs\bench.c"
|
RelativePath="..\..\..\programs\benchfn.c"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\..\programs\benchzstd.c"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
<File
|
<File
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ option(ZSTD_LEGACY_SUPPORT "LEGACY SUPPORT" OFF)
|
|||||||
|
|
||||||
if (ZSTD_LEGACY_SUPPORT)
|
if (ZSTD_LEGACY_SUPPORT)
|
||||||
message(STATUS "ZSTD_LEGACY_SUPPORT defined!")
|
message(STATUS "ZSTD_LEGACY_SUPPORT defined!")
|
||||||
add_definitions(-DZSTD_LEGACY_SUPPORT=4)
|
add_definitions(-DZSTD_LEGACY_SUPPORT=5)
|
||||||
else ()
|
else ()
|
||||||
message(STATUS "ZSTD_LEGACY_SUPPORT not defined!")
|
message(STATUS "ZSTD_LEGACY_SUPPORT not defined!")
|
||||||
add_definitions(-DZSTD_LEGACY_SUPPORT=0)
|
add_definitions(-DZSTD_LEGACY_SUPPORT=0)
|
||||||
|
|||||||
+14
-1
@@ -423,7 +423,17 @@ static FILE* FIO_openDstFile(const char* srcFileName, const char* dstFileName)
|
|||||||
return stdout;
|
return stdout;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* ensure dst is not the same file as src */
|
||||||
if (srcFileName != NULL) {
|
if (srcFileName != NULL) {
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
/* note : Visual does not support file identification by inode.
|
||||||
|
* The following work-around is limited to detecting exact name repetition only,
|
||||||
|
* aka `filename` is considered different from `subdir/../filename` */
|
||||||
|
if (!strcmp(srcFileName, dstFileName)) {
|
||||||
|
DISPLAYLEVEL(1, "zstd: Refusing to open a output file which will overwrite the input file \n");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
#else
|
||||||
stat_t srcStat;
|
stat_t srcStat;
|
||||||
stat_t dstStat;
|
stat_t dstStat;
|
||||||
if (UTIL_getFileStat(srcFileName, &srcStat)
|
if (UTIL_getFileStat(srcFileName, &srcStat)
|
||||||
@@ -432,7 +442,10 @@ static FILE* FIO_openDstFile(const char* srcFileName, const char* dstFileName)
|
|||||||
&& srcStat.st_ino == dstStat.st_ino) {
|
&& srcStat.st_ino == dstStat.st_ino) {
|
||||||
DISPLAYLEVEL(1, "zstd: Refusing to open a output file which will overwrite the input file \n");
|
DISPLAYLEVEL(1, "zstd: Refusing to open a output file which will overwrite the input file \n");
|
||||||
return NULL;
|
return NULL;
|
||||||
} } }
|
}
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
if (g_sparseFileSupport == 1) {
|
if (g_sparseFileSupport == 1) {
|
||||||
g_sparseFileSupport = ZSTD_SPARSE_DEFAULT;
|
g_sparseFileSupport = ZSTD_SPARSE_DEFAULT;
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ extern "C" {
|
|||||||
# define _CRT_SECURE_NO_DEPRECATE /* VS2005 - must be declared before <io.h> and <windows.h> */
|
# define _CRT_SECURE_NO_DEPRECATE /* VS2005 - must be declared before <io.h> and <windows.h> */
|
||||||
# define snprintf sprintf_s /* snprintf unsupported by Visual <= 2013 */
|
# define snprintf sprintf_s /* snprintf unsupported by Visual <= 2013 */
|
||||||
# endif
|
# endif
|
||||||
|
# pragma warning(disable : 4127) /* disable: C4127: conditional expression is constant */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
+4
-4
@@ -192,8 +192,8 @@ chmod 400 tmpro.zst
|
|||||||
$ZSTD -q tmpro && die "should have refused to overwrite read-only file"
|
$ZSTD -q tmpro && die "should have refused to overwrite read-only file"
|
||||||
$ZSTD -q -f tmpro
|
$ZSTD -q -f tmpro
|
||||||
$ECHO "test: --no-progress flag"
|
$ECHO "test: --no-progress flag"
|
||||||
$ZSTD tmpro -c --no-progress | $ZSTD -d -o "$INTOVOID" --no-progress
|
$ZSTD tmpro -c --no-progress | $ZSTD -d -f -o "$INTOVOID" --no-progress
|
||||||
$ZSTD tmpro -cv --no-progress | $ZSTD -dv -o "$INTOVOID" --no-progress
|
$ZSTD tmpro -cv --no-progress | $ZSTD -dv -f -o "$INTOVOID" --no-progress
|
||||||
rm -f tmpro tmpro.zst
|
rm -f tmpro tmpro.zst
|
||||||
$ECHO "test: overwrite input file (must fail)"
|
$ECHO "test: overwrite input file (must fail)"
|
||||||
$ZSTD tmp -fo tmp && die "zstd compression overwrote the input file"
|
$ZSTD tmp -fo tmp && die "zstd compression overwrote the input file"
|
||||||
@@ -232,7 +232,7 @@ rm tmp*
|
|||||||
$ECHO "test : compress multiple files"
|
$ECHO "test : compress multiple files"
|
||||||
$ECHO hello > tmp1
|
$ECHO hello > tmp1
|
||||||
$ECHO world > tmp2
|
$ECHO world > tmp2
|
||||||
$ZSTD tmp1 tmp2 -o "$INTOVOID"
|
$ZSTD tmp1 tmp2 -o "$INTOVOID" -f
|
||||||
$ZSTD tmp1 tmp2 -c | $ZSTD -t
|
$ZSTD tmp1 tmp2 -c | $ZSTD -t
|
||||||
$ZSTD tmp1 tmp2 -o tmp.zst
|
$ZSTD tmp1 tmp2 -o tmp.zst
|
||||||
test ! -f tmp1.zst
|
test ! -f tmp1.zst
|
||||||
@@ -240,7 +240,7 @@ test ! -f tmp2.zst
|
|||||||
$ZSTD tmp1 tmp2
|
$ZSTD tmp1 tmp2
|
||||||
$ZSTD -t tmp1.zst tmp2.zst
|
$ZSTD -t tmp1.zst tmp2.zst
|
||||||
$ZSTD -dc tmp1.zst tmp2.zst
|
$ZSTD -dc tmp1.zst tmp2.zst
|
||||||
$ZSTD tmp1.zst tmp2.zst -o "$INTOVOID"
|
$ZSTD tmp1.zst tmp2.zst -o "$INTOVOID" -f
|
||||||
$ZSTD -d tmp1.zst tmp2.zst -o tmp
|
$ZSTD -d tmp1.zst tmp2.zst -o tmp
|
||||||
touch tmpexists
|
touch tmpexists
|
||||||
$ZSTD tmp1 tmp2 -f -o tmpexists
|
$ZSTD tmp1 tmp2 -f -o tmpexists
|
||||||
|
|||||||
Reference in New Issue
Block a user