[util] Fix up previous commit
authorBehdad Esfahbod <behdad@behdad.org>
Tue, 6 Nov 2018 16:03:34 +0000 (11:03 -0500)
committerBehdad Esfahbod <behdad@behdad.org>
Tue, 6 Nov 2018 16:03:34 +0000 (11:03 -0500)
util/options.cc

index 3b22ca7..3f8fa3d 100644 (file)
@@ -729,9 +729,13 @@ const char *
 text_options_t::get_line (unsigned int *len)
 {
   if (text) {
-    if (!line) line = text;
-    if (line_len == (unsigned int) -1)
+    if (!line)
+    {
+      line = text;
       line_len = text_len;
+    }
+    if (line_len == (unsigned int) -1)
+      line_len = strlen (line);
 
     if (!line_len) {
       *len = 0;