]> eyrie.org Git - kerberos/kftgt.git/commitdiff
Fix the code for -v so that it will still work after a cvs export.
authorRuss Allbery <rra@stanford.edu>
Wed, 18 May 2005 03:32:17 +0000 (03:32 +0000)
committerRuss Allbery <rra@stanford.edu>
Mon, 15 Mar 2010 06:05:55 +0000 (23:05 -0700)
klogin
krsh

diff --git a/klogin b/klogin
index b9ce8f824661e638ce025b63740be0f72aaf5d28..d9f11732ae3d91cafc54766b6efcbe707c41e1fe 100755 (executable)
--- a/klogin
+++ b/klogin
@@ -157,7 +157,9 @@ sub parse_options {
     # If they requested usage or version, give them that and exit.
     if ($CONFIG{help}) { usage }
     if ($CONFIG{version}) {
-        my $version = join (' ', (split (' ', $ID))[1..3]);
+        my @version = split (' ', $ID);
+        shift @version if $ID =~ /^\$Id/;
+        my $version = join (' ', @version[0..2]);
         $version =~ s/,v\b//;
         $version =~ s/(\S+)$/($1)/;
         $version =~ tr%/%-%;
diff --git a/krsh b/krsh
index ac3e241c0fcef50f10ec62d62a942a7024e28185..3a184b21d990e73d319d44b7620be666f154dc63 100755 (executable)
--- a/krsh
+++ b/krsh
@@ -109,7 +109,9 @@ sub parse_options {
     # If they requested usage or version, give them that and exit.
     if ($CONFIG{help}) { usage }
     if ($CONFIG{version}) {
-        my $version = join (' ', (split (' ', $ID))[1..3]);
+        my @version = split (' ', $ID);
+        shift @version if $ID =~ /^\$Id/;
+        my $version = join (' ', @version[0..2]);
         $version =~ s/,v\b//;
         $version =~ s/(\S+)$/($1)/;
         $version =~ tr%/%-%;