Skip to content

Commit

Permalink
Repair version string
Browse files Browse the repository at this point in the history
  • Loading branch information
phaag committed Oct 14, 2023
1 parent ec8b602 commit 3ac05de
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/lib/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,17 @@ char *versionString(void) {
#endif

char *zstdlib = "";
#ifdef HAVE_ZSTDLIB
#ifdef HAVE_ZSTD
zstdlib = " ZSTD";
#endif

char *bzlib = "";
#ifdef HAVE_ZSTD
bzlib = " BZIP2";
#endif

char *option = (strlen(nsel) + strlen(zstdlib)) > 0 ? "Options:" : "";
snprintf(version_string, 128, "Version: %s-%s %s%s%s Date: %s", VERSION, VCS_TRACK_HASH, option, nsel, zstdlib, VCS_TRACK_DATE);
snprintf(version_string, 128, "Version: %s-%s %s%s%s%s Date: %s", VERSION, VCS_TRACK_HASH, option, nsel, zstdlib, bzlib, VCS_TRACK_DATE);
version_string[127] = '\0';

return version_string;
Expand Down
2 changes: 2 additions & 0 deletions src/lib/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
#ifndef __VERSION_H
#define __VERSION_H 1

#include "config.h"

char *versionString(void);

#endif

0 comments on commit 3ac05de

Please sign in to comment.