Added support for empty lines to here documents
authorClifford Wolf <clifford@clifford.at>
Wed, 29 Oct 2014 08:05:17 +0000 (09:05 +0100)
committerClifford Wolf <clifford@clifford.at>
Wed, 29 Oct 2014 08:05:17 +0000 (09:05 +0100)
kernel/register.cc

index 33c129d837a26a08b08c5d29d135d04b33e7a37b..2927a333ec78a62b3ee01aad0c65a798feba913a 100644 (file)
@@ -333,8 +333,8 @@ void Frontend::extra_args(std::istream *&f, std::string &filename, std::vector<s
                                        if (buffer.size() > 0 && (buffer[buffer.size() - 1] == '\n' || buffer[buffer.size() - 1] == '\r'))
                                                break;
                                }
-                               int indent = buffer.find_first_not_of(" \t\r\n");
-                               if (buffer.substr(indent, eot_marker.size()) == eot_marker)
+                               size_t indent = buffer.find_first_not_of(" \t\r\n");
+                               if (indent != std::string::npos && buffer.substr(indent, eot_marker.size()) == eot_marker)
                                        break;
                                last_here_document += buffer;
                        }