diff options
-rw-r--r-- | bzip2.c | 10 | ||||
-rw-r--r-- | bzlib.c | 2 | ||||
-rw-r--r-- | bzlib.h | 15 |
3 files changed, 17 insertions, 10 deletions
@@ -1767,8 +1767,8 @@ void addFlagsFromEnvVar ( Cell** argList, Char* varName ) | |||
1767 | if (p[i] == 0) break; | 1767 | if (p[i] == 0) break; |
1768 | p += i; | 1768 | p += i; |
1769 | i = 0; | 1769 | i = 0; |
1770 | while (isspace((Int32)(p[0]))) p++; | 1770 | while (isspace((UChar)(p[0]))) p++; |
1771 | while (p[i] != 0 && !isspace((Int32)(p[i]))) i++; | 1771 | while (p[i] != 0 && !isspace((UChar)(p[i]))) i++; |
1772 | if (i > 0) { | 1772 | if (i > 0) { |
1773 | k = i; if (k > FILE_NAME_LEN-10) k = FILE_NAME_LEN-10; | 1773 | k = i; if (k > FILE_NAME_LEN-10) k = FILE_NAME_LEN-10; |
1774 | for (j = 0; j < k; j++) tmpName[j] = p[j]; | 1774 | for (j = 0; j < k; j++) tmpName[j] = p[j]; |
@@ -1825,7 +1825,11 @@ IntNative main ( IntNative argc, Char *argv[] ) | |||
1825 | copyFileName ( inName, (Char*)"(none)" ); | 1825 | copyFileName ( inName, (Char*)"(none)" ); |
1826 | copyFileName ( outName, (Char*)"(none)" ); | 1826 | copyFileName ( outName, (Char*)"(none)" ); |
1827 | 1827 | ||
1828 | copyFileName ( progNameReally, argv[0] ); | 1828 | if (argc >= 1 && argv[0] != NULL) |
1829 | copyFileName ( progNameReally, argv[0] ); | ||
1830 | else | ||
1831 | copyFileName ( progNameReally, (Char*)"bzip2" ); | ||
1832 | |||
1829 | progName = &progNameReally[0]; | 1833 | progName = &progNameReally[0]; |
1830 | for (tmp = &progNameReally[0]; *tmp != '\0'; tmp++) | 1834 | for (tmp = &progNameReally[0]; *tmp != '\0'; tmp++) |
1831 | if (*tmp == PATH_SEP) progName = tmp + 1; | 1835 | if (*tmp == PATH_SEP) progName = tmp + 1; |
@@ -1408,7 +1408,7 @@ BZFILE * bzopen_or_bzdopen | |||
1408 | case 's': | 1408 | case 's': |
1409 | smallMode = 1; break; | 1409 | smallMode = 1; break; |
1410 | default: | 1410 | default: |
1411 | if (isdigit((int)(*mode))) { | 1411 | if (isdigit((unsigned char)(*mode))) { |
1412 | blockSize100k = *mode-BZ_HDR_0; | 1412 | blockSize100k = *mode-BZ_HDR_0; |
1413 | } | 1413 | } |
1414 | } | 1414 | } |
@@ -22,6 +22,15 @@ | |||
22 | #ifndef _BZLIB_H | 22 | #ifndef _BZLIB_H |
23 | #define _BZLIB_H | 23 | #define _BZLIB_H |
24 | 24 | ||
25 | #ifndef BZ_NO_STDIO | ||
26 | /* Need a definitition for FILE */ | ||
27 | #include <stdio.h> | ||
28 | #endif | ||
29 | |||
30 | #ifdef _WIN32 | ||
31 | #include <windows.h> | ||
32 | #endif | ||
33 | |||
25 | #ifdef __cplusplus | 34 | #ifdef __cplusplus |
26 | extern "C" { | 35 | extern "C" { |
27 | #endif | 36 | #endif |
@@ -70,13 +79,7 @@ typedef | |||
70 | #define BZ_EXPORT | 79 | #define BZ_EXPORT |
71 | #endif | 80 | #endif |
72 | 81 | ||
73 | #ifndef BZ_NO_STDIO | ||
74 | /* Need a definitition for FILE */ | ||
75 | #include <stdio.h> | ||
76 | #endif | ||
77 | |||
78 | #ifdef _WIN32 | 82 | #ifdef _WIN32 |
79 | # include <windows.h> | ||
80 | # ifdef small | 83 | # ifdef small |
81 | /* windows.h define small to char */ | 84 | /* windows.h define small to char */ |
82 | # undef small | 85 | # undef small |