Skip to content

Commit 6d4af0e

Browse files
committed
Fixes an edge case when buffer is empty
sass@e5a8ea7
1 parent 9569ba1 commit 6d4af0e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

output_compressed.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ namespace Sass {
6161
}
6262
}
6363
size_t l = buffer.length();
64-
buffer.erase(l-1);
64+
if (l > 0 && buffer.at(l - 1) == ';') buffer.erase(l - 1);
6565
append_singleline_part_to_buffer("}");
6666
}
6767

@@ -90,7 +90,7 @@ namespace Sass {
9090
}
9191
return;
9292
}
93-
93+
9494
ctx->source_map.add_mapping(m);
9595
append_singleline_part_to_buffer("@media ");
9696
q->perform(this);
@@ -108,9 +108,9 @@ namespace Sass {
108108
stm->perform(this);
109109
}
110110
}
111-
111+
112112
append_singleline_part_to_buffer("}");
113-
113+
114114
for (size_t i = 0, L = b->length(); i < L; ++i) {
115115
Statement* stm = (*b)[i];
116116
if (stm->is_hoistable()) {
@@ -328,7 +328,7 @@ namespace Sass {
328328
{
329329
tail->perform(this);
330330
return;
331-
}
331+
}
332332
if (head && !head->is_empty_reference()) head->perform(this);
333333
switch (comb) {
334334
case Complex_Selector::ANCESTOR_OF:

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy