svn commit: r232666 - head/usr.sbin/crashinfo

Ed Maste emaste at FreeBSD.org
Wed Mar 7 18:46:21 UTC 2012


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)
 


More information about the svn-src-all mailing list