about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/libutil/util.cc1
-rw-r--r--src/log2xml/log2xml.cc11
2 files changed, 11 insertions, 1 deletions
diff --git a/src/libutil/util.cc b/src/libutil/util.cc
index bf14e8aadfaa..87b2ef236365 100644
--- a/src/libutil/util.cc
+++ b/src/libutil/util.cc
@@ -279,6 +279,7 @@ void Nest::close()
         nestingLevel--;
         if (logType == ltEscapes)
             cerr << "\033[q";
+        nest = false;
     }
 }
 
diff --git a/src/log2xml/log2xml.cc b/src/log2xml/log2xml.cc
index 66e182452844..a4955dc6e82d 100644
--- a/src/log2xml/log2xml.cc
+++ b/src/log2xml/log2xml.cc
@@ -16,6 +16,7 @@ struct Decoder
     bool newNumber;
     int priority;
     bool ignoreLF;
+    int lineNo, charNo;
 
     Decoder()
     {
@@ -25,6 +26,8 @@ struct Decoder
         level = 0;
         priority = 1;
         ignoreLF = false;
+        lineNo = 1;
+        charNo = 0;
     }
 
     void pushChar(char c);
@@ -35,6 +38,11 @@ struct Decoder
 
 void Decoder::pushChar(char c)
 {
+    if (c == '\n') {
+        lineNo++;
+        charNo = 0;
+    } else charNo++;
+    
     switch (state) {
         
         case stTop:
@@ -71,7 +79,8 @@ void Decoder::pushChar(char c)
                             level--;
                             cout << "</nest>" << endl;
                         } else
-                            cerr << "not enough nesting levels" << endl;
+                            cerr << "not enough nesting levels at line "
+                                 << lineNo << ", character " << charNo  << endl;
                         break;
                     case 's':
                         if (line.size()) finishLine();