Skip to content

Commit

Permalink
Merge pull request #203 from sass/bug/gh-202-sourcemap-file-not-written
Browse files Browse the repository at this point in the history
Use context object to get map file path
  • Loading branch information
am11 authored Dec 12, 2016
2 parents bf2a24d + 9a182ff commit c611b7c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sassc.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ int compile_file(struct Sass_Options* options, char* input_path, char* outfile)
struct Sass_File_Context* ctx = sass_make_file_context(input_path);
struct Sass_Context* ctx_out = sass_file_context_get_context(ctx);
if (outfile) sass_option_set_output_path(options, outfile);
const char* srcmap_file = sass_option_get_source_map_file(options);
sass_option_set_input_path(options, input_path);
sass_file_context_set_options(ctx, options);

Expand All @@ -150,12 +151,12 @@ int compile_file(struct Sass_Options* options, char* input_path, char* outfile)
outfile
);

if (ret == 0 && sass_option_get_source_map_file(options)) {
if (ret == 0 && srcmap_file) {
ret = output(
sass_context_get_error_status(ctx_out),
sass_context_get_error_message(ctx_out),
sass_context_get_source_map_string(ctx_out),
sass_option_get_source_map_file(options)
srcmap_file
);
}

Expand Down

0 comments on commit c611b7c

Please sign in to comment.