summaryrefslogtreecommitdiffstats
path: root/usr.sbin/crashinfo
diff options
context:
space:
mode:
authoremaste <emaste@FreeBSD.org>2012-03-07 18:46:21 +0000
committeremaste <emaste@FreeBSD.org>2012-03-07 18:46:21 +0000
commit30c566d1d8e6e21a5fd40a35bf859a12e9ba03e1 (patch)
treee033b807ce2dbfb0bd398c1d9b48af6daa9c1aa1 /usr.sbin/crashinfo
parent9aeef561833ba00c4d4fd175b6d20d03b0deecae (diff)
downloadFreeBSD-src-30c566d1d8e6e21a5fd40a35bf859a12e9ba03e1.zip
FreeBSD-src-30c566d1d8e6e21a5fd40a35bf859a12e9ba03e1.tar.gz
Improve multi-line kernel ident parsing
Instead of blindly grabbing the line with 'Version string' and the following one from the core info file, take all lines after 'Version string' until the one one that matches the field format in the core info file. This provides compatibility with VendorBSD modifications that have a different kernel ident format. Reviewed by: jhb
Diffstat (limited to 'usr.sbin/crashinfo')
-rwxr-xr-xusr.sbin/crashinfo/crashinfo.sh7
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.sbin/crashinfo/crashinfo.sh b/usr.sbin/crashinfo/crashinfo.sh
index 89013a2..b1bfc06 100755
--- a/usr.sbin/crashinfo/crashinfo.sh
+++ b/usr.sbin/crashinfo/crashinfo.sh
@@ -45,10 +45,11 @@ find_kernel()
nextline=1
next
}
- // {
- if (nextline) {
- print
+ nextline==1 {
+ if ($0 ~ "^ [A-Za-z ]+: ") {
nextline=0
+ } else {
+ print
}
}' $INFO)
OpenPOWER on IntegriCloud