diff options
author | josh.macdonald <jmacd@users.noreply.github.com> | 2007-02-13 19:08:53 +0000 |
---|---|---|
committer | josh.macdonald <jmacd@users.noreply.github.com> | 2007-02-13 19:08:53 +0000 |
commit | 8c968ee7b98144c43e7453c026892abee5536e0c (patch) | |
tree | 457821fe9b23eb12f33dd640739c2379fbac476f | |
parent | 990289208d555a760499623e30682d6fe19216e7 (diff) |
Fix parsing error for 0-instruction patch files.
Exit 0 on success for delta_command(). Used to exit 0 or 1 like diff.
-rw-r--r-- | xdelta1/libedsio/edsio.el | 3 | ||||
-rw-r--r-- | xdelta1/xdmain.c | 9 |
2 files changed, 8 insertions, 4 deletions
diff --git a/xdelta1/libedsio/edsio.el b/xdelta1/libedsio/edsio.el index d8cd91e..8c15215 100644 --- a/xdelta1/libedsio/edsio.el +++ b/xdelta1/libedsio/edsio.el | |||
@@ -1017,7 +1017,7 @@ replacement is as for replace-regexp." | |||
1017 | (format "%s{ | 1017 | (format "%s{ |
1018 | %s gint i; | 1018 | %s gint i; |
1019 | %s if (! (* source->next_uint) (source, &%s_len)) goto bail; | 1019 | %s if (! (* source->next_uint) (source, &%s_len)) goto bail; |
1020 | %s if (! (%s = serializeio_source_alloc (source, sizeof (%s) * %s_len))) goto bail; | 1020 | %s if ((%s_len > 0) && ! (%s = serializeio_source_alloc (source, sizeof (%s) * %s_len))) goto bail; |
1021 | %s for (i = 0; i < %s_len; i += 1) | 1021 | %s for (i = 0; i < %s_len; i += 1) |
1022 | %s { | 1022 | %s { |
1023 | %s%s } | 1023 | %s%s } |
@@ -1028,6 +1028,7 @@ replacement is as for replace-regexp." | |||
1028 | name | 1028 | name |
1029 | prefix | 1029 | prefix |
1030 | name | 1030 | name |
1031 | name | ||
1031 | (field-ctype (cadr field)) | 1032 | (field-ctype (cadr field)) |
1032 | name | 1033 | name |
1033 | prefix | 1034 | prefix |
diff --git a/xdelta1/xdmain.c b/xdelta1/xdmain.c index ca7cdf4..8b6b800 100644 --- a/xdelta1/xdmain.c +++ b/xdelta1/xdmain.c | |||
@@ -39,7 +39,7 @@ | |||
39 | #ifndef WINHACK | 39 | #ifndef WINHACK |
40 | #include <unistd.h> | 40 | #include <unistd.h> |
41 | #include <sys/mman.h> | 41 | #include <sys/mman.h> |
42 | #define O_BINARY 0 | 42 | // #define O_BINARY 0 |
43 | 43 | ||
44 | #else /* WINHACK */ | 44 | #else /* WINHACK */ |
45 | 45 | ||
@@ -260,6 +260,7 @@ help () | |||
260 | xd_error (" -h, --help Print this summary\n"); | 260 | xd_error (" -h, --help Print this summary\n"); |
261 | xd_error (" -n, --noverify Disable automatic MD5 verification\n"); | 261 | xd_error (" -n, --noverify Disable automatic MD5 verification\n"); |
262 | xd_error (" -p, --pristine Disable automatic GZIP decompression\n"); | 262 | xd_error (" -p, --pristine Disable automatic GZIP decompression\n"); |
263 | xd_error (" -q, --quiet Do not print warnings\n"); | ||
263 | xd_error (" -m, --maxmem=SIZE Set the buffer size limit, e.g. 640K, 16M\n"); | 264 | xd_error (" -m, --maxmem=SIZE Set the buffer size limit, e.g. 640K, 16M\n"); |
264 | xd_error (" -[0-9] ZLIB compress level: 0=none, 1=fast, 6=default, 9=best\n"); | 265 | xd_error (" -[0-9] ZLIB compress level: 0=none, 1=fast, 6=default, 9=best\n"); |
265 | xd_error (" -s=BLOCK_SIZE Sets block size (power of 2), minimum match length\n"); | 266 | xd_error (" -s=BLOCK_SIZE Sets block size (power of 2), minimum match length\n"); |
@@ -1527,7 +1528,6 @@ delta_command (gint argc, gchar** argv) | |||
1527 | xd_error ("using block size: %d bytes\n", xdp_blocksize ()); | 1528 | xd_error ("using block size: %d bytes\n", xdp_blocksize ()); |
1528 | } | 1529 | } |
1529 | 1530 | ||
1530 | |||
1531 | if (! (from = open_read_seek_handle (argv[0], &from_is_compressed, TRUE))) | 1531 | if (! (from = open_read_seek_handle (argv[0], &from_is_compressed, TRUE))) |
1532 | return 2; | 1532 | return 2; |
1533 | 1533 | ||
@@ -1647,7 +1647,10 @@ delta_command (gint argc, gchar** argv) | |||
1647 | 1647 | ||
1648 | xdp_generator_free (gen); | 1648 | xdp_generator_free (gen); |
1649 | 1649 | ||
1650 | return control_offset != header_offset; | 1650 | /* Note: prior to 1.1.5: |
1651 | * return control_offset != header_offset; | ||
1652 | */ | ||
1653 | return 0; | ||
1651 | } | 1654 | } |
1652 | 1655 | ||
1653 | static XdeltaPatch* | 1656 | static XdeltaPatch* |