about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--subx/038---literal_strings.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/subx/038---literal_strings.cc b/subx/038---literal_strings.cc
index 5afda221..db8579a3 100644
--- a/subx/038---literal_strings.cc
+++ b/subx/038---literal_strings.cc
@@ -141,7 +141,7 @@ void parse_instruction_character_by_character(const string& line_data, vector<li
       result.words.back().data = d.str();
       // slurp metadata
       ostringstream m;
-      while (!isspace(in.peek()) && has_data(in)) {
+      while (!isspace(in.peek()) && has_data(in)) {  // peek can sometimes trigger eof(), so do it first
         in >> c;
         if (c == '/') {
           if (!m.str().empty()) result.words.back().metadata.push_back(m.str());