From 12a0396bba2f2e869168ab9824a48f385a4405f8 Mon Sep 17 00:00:00 2001 From: Miles Bader Date: Mon, 12 Aug 1996 21:16:54 +0000 Subject: Don't assume the edit version is <= 26. --- libdiskfs/opts-version.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/libdiskfs/opts-version.c b/libdiskfs/opts-version.c index 06d1e0be..d0d687e1 100644 --- a/libdiskfs/opts-version.c +++ b/libdiskfs/opts-version.c @@ -31,15 +31,19 @@ _print_version (FILE *stream, struct argp_state *state) fprintf (stream, "%s\n", argp_program_version); else /* Construct a version using the standard diskfs variables. */ - if (diskfs_edit_version) - fprintf (stream, "%s %d.%d%c (GNU %s)\n", - diskfs_server_name, diskfs_major_version, diskfs_minor_version, - diskfs_edit_version + 'a', HURD_RELEASE); - else - /* Construct a version using the standard diskfs variables. */ - fprintf (stream, "%s %d.%d (GNU %s)\n", + { + char *ev[15] = { 0 }; + + if (diskfs_edit_version) + if (diskfs_edit_version <= 26) + 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, - HURD_RELEASE); + ev, HURD_RELEASE); + } } void (*argp_program_version_hook) (FILE *stream, struct argp_state *state) -- cgit v1.2.3