[coreboot-gerrit] New patch to review for coreboot: f7782c1 util/cbmem: Convert line endings to UNIX standard

Timothy Pearson (tpearson@raptorengineeringinc.com) gerrit at coreboot.org
Sun Mar 22 03:52:09 CET 2015


Timothy Pearson (tpearson at raptorengineeringinc.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/8857

-gerrit

commit f7782c1d6e8767b1105e28e7041cab22a14d995d
Author: Timothy Pearson <tpearson at raptorengineeringinc.com>
Date:   Sat Mar 21 21:49:27 2015 -0500

    util/cbmem: Convert line endings to UNIX standard
    
    The cbmem console output retains usage of the CR line ending.
    Converting line endings to the standard UNIX LF avoids the
    need to use dos2unix before running analysis on log files.
    
    Change-Id: I74a04ee69836d82640c94f250465acb4d1ee1071
    Signed-off-by: Timothy Pearson <tpearson at raptorengineeringinc.com>
---
 util/cbmem/cbmem.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/util/cbmem/cbmem.c b/util/cbmem/cbmem.c
index 4314d30..67f0e87 100644
--- a/util/cbmem/cbmem.c
+++ b/util/cbmem/cbmem.c
@@ -1,6 +1,7 @@
 /*
  * This file is part of the coreboot project.
  *
+ * Copyright 2015 Timothy Pearson, Raptor Engineering <tpearson at raptorengineeringinc.com>
  * Copyright 2012 Google Inc.
  *
  * This program is free software; you can redistribute it and/or modify
@@ -467,6 +468,7 @@ static void dump_console(void)
 	char *console_c;
 	uint32_t size;
 	uint32_t cursor;
+	uint32_t pos;
 
 	if (console.tag != LB_TAG_CBMEM_CONSOLE) {
 		fprintf(stderr, "No console found in coreboot table.\n");
@@ -501,6 +503,11 @@ static void dump_console(void)
 	console_c[size] = 0;
 	console_c[cursor] = 0;
 
+	/* Convert line endings */
+	for (pos = 0; pos < size; pos++)
+		if (console_c[pos] == '\r')
+			console_c[pos] = '\n';
+
 	printf("%s\n", console_c);
 	if (size < cursor)
 		printf("%d %s lost\n", cursor - size,



More information about the coreboot-gerrit mailing list