diff --git a/archive/pc_archive.c b/archive/pc_archive.c index c551294..dff9625 100644 --- a/archive/pc_archive.c +++ b/archive/pc_archive.c @@ -362,7 +362,7 @@ archiver_write(void *ctx, void *buf, uint64_t count) } if (pctx->arc_buf != NULL) { - log_msg(LOG_ERR, 0, "Incorrect sequencing of archiver_read() call."); + log_msg(LOG_ERR, 0, "Incorrect sequencing of archiver_write() call."); return (-1); } @@ -661,7 +661,7 @@ add_pathname(const char *fpath, const struct stat *sb, /* * Sort Buffer is full so sort it. Sorting is done by file extension and size. - * If file has no extension then first 4 chars of the filename are used. + * If file has no extension then an algorithm is used, described below. */ srt = (struct sort_buf *)malloc(sizeof (struct sort_buf)); if (srt == NULL) { @@ -742,7 +742,7 @@ add_pathname(const char *fpath, const struct stat *sb, */ nsep = 0; for (i = 0; i < plen; i++) { - if (fpath[i] == '/') { + if (fpath[i] == PATHSEP_CHAR) { nsep++; } } diff --git a/meta_stream.c b/meta_stream.c index 66c492e..b22c335 100644 --- a/meta_stream.c +++ b/meta_stream.c @@ -245,6 +245,7 @@ metadata_compress(void *dat) * compress and write the buffer. */ memcpy(mctx->frombuf + mctx->frompos, msgp->buf, msgp->len); + mctx->frompos += msgp->len; if (!compress_and_write(mctx)) { Write(mctx->meta_pipes[SINK_CHANNEL], &ack, sizeof (ack)); return (NULL); diff --git a/pcompress.c b/pcompress.c index 56fb603..99618a2 100644 --- a/pcompress.c +++ b/pcompress.c @@ -3590,6 +3590,16 @@ init_pc_context(pc_ctx_t *pctx, int argc, char *argv[]) } } + if (pctx->archive_mode) { + if (pctx->meta_stream != -1) + pctx->meta_stream = 1; + else + pctx->meta_stream = 0; + } + + if (pctx->pipe_mode) + pctx->meta_stream = 0; + /* * Auto-select filters and preprocessing modes based on compresion level. * This is not done if user explicitly specified advanced options. @@ -3607,12 +3617,6 @@ init_pc_context(pc_ctx_t *pctx, int argc, char *argv[]) pctx->enable_packjpg = ff.enable_packjpg; pctx->enable_wavpack = ff.enable_wavpack; if (pctx->level > 8) pctx->exe_preprocess = 1; - if (pctx->meta_stream != -1) - pctx->meta_stream = 1; - else - pctx->meta_stream = 0; - if (pctx->pipe_mode) - pctx->meta_stream = 0; } /*