Skip to content

Commit

Permalink
Fixes bug in source map handling (credit to @am11)
Browse files Browse the repository at this point in the history
  • Loading branch information
mgreter committed Oct 31, 2014
1 parent 8e29956 commit 0732248
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions source_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ namespace Sass {
json_append_member(json_srcmap, "version", json_mknumber(3));

if (source_index.size() > 0) {
const char *include = includes[source_index[0]].c_str();
const char *include = file.c_str();
JsonNode *json_include = json_mkstring(include);
json_append_member(json_srcmap, "file", json_include);
}

JsonNode *json_includes = json_mkarray();
for (size_t i = 1; i < source_index.size(); ++i) {
for (size_t i = 0; i < source_index.size(); ++i) {
const char *include = includes[source_index[i]].c_str();
JsonNode *json_include = json_mkstring(include);
json_append_element(json_includes, json_include);
Expand All @@ -48,8 +48,8 @@ namespace Sass {
}
json_append_member(json_srcmap, "sourcesContent", json_contents);

const char *mappings = serialize_mappings().c_str();
JsonNode *json_mappings = json_mkstring(mappings);
string mappings = serialize_mappings();
JsonNode *json_mappings = json_mkstring(mappings.c_str());
json_append_member(json_srcmap, "mappings", json_mappings);

JsonNode *json_names = json_mkarray();
Expand Down

0 comments on commit 0732248

Please sign in to comment.