about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2015-05-30 12:34:40 -0700
committerKartik K. Agaram <vc@akkartik.com>2015-05-30 12:34:40 -0700
commit1d0a623ac62cb7ba317cc7cd1afe0b10d67b5172 (patch)
tree006015ab8b0d55727c549069f5d847e547000453
parent3d68a0b026e6551e962124f3a1831120dbd553b7 (diff)
downloadmu-1d0a623ac62cb7ba317cc7cd1afe0b10d67b5172.tar.gz
1515 - complain on unbalanced brackets
-rw-r--r--013literal_string.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/013literal_string.cc b/013literal_string.cc
index 02e8ea93..b31bc702 100644
--- a/013literal_string.cc
+++ b/013literal_string.cc
@@ -48,6 +48,10 @@ string slurp_quoted(istream& in) {
     if (c == ']') --brace_depth;
     if (brace_depth == 0) break;
   }
+  if (in.eof() && brace_depth > 0) {
+    raise << "unbalanced '['\n";
+    return "";
+  }
   return out.str();
 }
 
Booth <boothj5@gmail.com> 2014-02-16 19:14:15 +0000 committer James Booth <boothj5@gmail.com> 2014-02-16 19:14:15 +0000 Mock otr module for cmd_otr tests' href='/danisanti/profani-tty/commit/tests/config/mock_accounts.h?id=a21ab6d4c8d9de9abce9dddd1d23668779ca15e7'>a21ab6d4 ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92