Skip to content

Commit f67b27a

Browse files
committed
Fix string operation with non string types
1 parent 0ae11a4 commit f67b27a

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
@@ -1277,8 +1277,10 @@ namespace Sass {
12771277
}
12781278
if (ltype == Expression::NULL_VAL) error("invalid null operation: \"null plus "+quote(unquote(rstr), '"')+"\".", lhs.pstate());
12791279
if (rtype == Expression::NULL_VAL) error("invalid null operation: \""+quote(unquote(lstr), '"')+" plus null\".", rhs.pstate());
1280-
std::string result((lstr) + sep + (rstr));
1281-
String_Quoted* str = new (mem) String_Quoted(lhs.pstate(), result);
1280+
1281+
String_Constant* str = ltype == Expression::STRING || sep == ""
1282+
? new (mem) String_Quoted(lhs.pstate(), (lstr) + sep + (rstr))
1283+
: new (mem) String_Constant(lhs.pstate(), (lstr) + sep + quote(rstr));
12821284
str->quote_mark(0);
12831285
return str;
12841286
}

0 commit comments

Comments
 (0)