summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2016-11-17 23:45:37 (GMT)
committerH. Peter Anvin <hpa@zytor.com>2016-11-17 23:45:37 (GMT)
commitfd699638e0f472c8e34ea87313c96185b5ceafd5 (patch)
treed578124bb159801b21cfa7be964a4524784e9716
parentc92ace3b598c5bc3b456111015ccad8df73b4c8b (diff)
downloadabc80-fd699638e0f472c8e34ea87313c96185b5ceafd5.zip
abc80-fd699638e0f472c8e34ea87313c96185b5ceafd5.tar.gz
abc80-fd699638e0f472c8e34ea87313c96185b5ceafd5.tar.bz2
abc80-fd699638e0f472c8e34ea87313c96185b5ceafd5.tar.xz
revrom.pl: put the text string at the end, with a pointer
The current text string is more than 128 characters long. However, we could shorten it in the future if we need to include more information. Thus, put it at the end, and leave a pointer to its address instead of hard-coding the address. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r--data/revrom.pl7
1 files changed, 4 insertions, 3 deletions
diff --git a/data/revrom.pl b/data/revrom.pl
index 3413a6f..4a8b967 100644
--- a/data/revrom.pl
+++ b/data/revrom.pl
@@ -25,11 +25,12 @@ $s .= POSIX::strftime("Build: %Y-%m-%d %H:%M:%S\n", @now);
my $rs;
($rs = $s) =~ s/\n/\r\n/g;
-my @sb = (int($year / 100), $year % 100, $mon, $now[3],
+$str_at = $depth - (length($rs) + 1);
+my @sb = ($str_at, int($year / 100), $year % 100, $mon, $now[3],
$now[2], $now[1], $now[0]);
-push(@sb, (0) x (128 - scalar(@sb))); # Reserved
+push(@sb, (0) x ($str_at - scalar(@sb))); # Reserved
push(@sb, unpack("C*", $rs));
-push(@sb, (0) x ($depth - scalar(@sb)));
+push(@sb, (0) x ($depth - scalar(@sb))); # Should be exactly one
print "%\n";
my $sq;