Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 7 Mar 2012 18:46:21 +0000 (UTC)
From:      Ed Maste <emaste@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r232666 - head/usr.sbin/crashinfo
Message-ID:  <201203071846.q27IkL9I005862@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: emaste
Date: Wed Mar  7 18:46:21 2012
New Revision: 232666
URL: http://svn.freebsd.org/changeset/base/232666

Log:
  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

Modified:
  head/usr.sbin/crashinfo/crashinfo.sh

Modified: head/usr.sbin/crashinfo/crashinfo.sh
==============================================================================
--- head/usr.sbin/crashinfo/crashinfo.sh	Wed Mar  7 18:33:11 2012	(r232665)
+++ head/usr.sbin/crashinfo/crashinfo.sh	Wed Mar  7 18:46:21 2012	(r232666)
@@ -45,10 +45,11 @@ find_kernel()
 		nextline=1
 		next
 	}
-	// {
-		if (nextline) {
-			print
+	nextline==1 {
+		if ($0 ~ "^  [A-Za-z ]+: ") {
 			nextline=0
+		} else {
+			print
 		}
 	}' $INFO)
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201203071846.q27IkL9I005862>