Skip to content

Commit 06ad34e

Browse files
committed
Merge pull request #1473 from mgreter/bugfix/string-op-non-lhs-strings
Fix string operation with non string types
2 parents e1c1d89 + f67b27a commit 06ad34e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/eval.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1290,8 +1290,10 @@ namespace Sass {
12901290
}
12911291
if (ltype == Expression::NULL_VAL) error("invalid null operation: \"null plus "+quote(unquote(rstr), '"')+"\".", lhs.pstate());
12921292
if (rtype == Expression::NULL_VAL) error("invalid null operation: \""+quote(unquote(lstr), '"')+" plus null\".", rhs.pstate());
1293-
std::string result((lstr) + sep + (rstr));
1294-
String_Quoted* str = new (mem) String_Quoted(lhs.pstate(), result);
1293+
1294+
String_Constant* str = ltype == Expression::STRING || sep == ""
1295+
? new (mem) String_Quoted(lhs.pstate(), (lstr) + sep + (rstr))
1296+
: new (mem) String_Constant(lhs.pstate(), (lstr) + sep + quote(rstr));
12951297
str->quote_mark(0);
12961298
return str;
12971299
}

0 commit comments

Comments
 (0)