summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1996-08-15 21:25:30 +0000
committerMiles Bader <miles@gnu.org>1996-08-15 21:25:30 +0000
commit426a0b54bee9c01e532623334c0bc2ff547e096d (patch)
tree64f53e0c0db25f63738a0a6d2b5176003a0f421a
parent06dd69abc8b8cea4489c44740c99f32f83c2c95d (diff)
(diskfs_extra_version): New (weak) reference.
(_print_version): Use DISKFS_EXTRA_VERSION. Tweak edit version. Fix type of EV.
-rw-r--r--libdiskfs/opts-version.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/libdiskfs/opts-version.c b/libdiskfs/opts-version.c
index d0d687e1..268a4017 100644
--- a/libdiskfs/opts-version.c
+++ b/libdiskfs/opts-version.c
@@ -22,6 +22,9 @@
#include "priv.h"
+extern char *diskfs_extra_version;
+#pragma weak diskfs_extra_version
+
static void
_print_version (FILE *stream, struct argp_state *state)
{
@@ -32,17 +35,22 @@ _print_version (FILE *stream, struct argp_state *state)
else
/* Construct a version using the standard diskfs variables. */
{
- char *ev[15] = { 0 };
+ char ev[15] = { 0 };
if (diskfs_edit_version)
if (diskfs_edit_version <= 26)
- sprintf (ev, ".%c", diskfs_edit_version - 1 + 'a');
+ sprintf (ev, "%c", diskfs_edit_version - 1 + 'a');
else
sprintf (ev, ".%d", diskfs_edit_version);
- fprintf (stream, "%s %d.%d%s (GNU %s)\n",
- diskfs_server_name, diskfs_major_version, diskfs_minor_version,
- ev, HURD_RELEASE);
+ if (diskfs_extra_version)
+ fprintf (stream, "%s %d.%d%s (%s, GNU %s)\n",
+ diskfs_server_name, diskfs_major_version, diskfs_minor_version,
+ ev, diskfs_extra_version, HURD_RELEASE);
+ else
+ fprintf (stream, "%s %d.%d%s (GNU %s)\n",
+ diskfs_server_name, diskfs_major_version, diskfs_minor_version,
+ ev, HURD_RELEASE);
}
}