Skip to content
This repository was archived by the owner on Oct 24, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions sassc.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,18 @@ int compile_file(struct sass_options options, char* input_path, char* outfile) {

ctx->options = options;
ctx->input_path = input_path;
if (outfile && (ctx->options.source_comments == SASS_SOURCE_COMMENTS_MAP)) {
const char* extension = ".map";
ctx->source_map_file = calloc(strlen(outfile) + strlen(extension) + 1, sizeof(char));
strcpy(ctx->source_map_file, outfile);
strcat(ctx->source_map_file, extension);
}

sass_compile_file(ctx);
ret = output(ctx->error_status, ctx->error_message, ctx->output_string, outfile);
if (outfile && (ctx->options.source_comments == SASS_SOURCE_COMMENTS_MAP)) {
ret = output(ctx->error_status, ctx->error_message, ctx->source_map_string, ctx->source_map_file);
}

sass_free_file_context(ctx);
return ret;
Expand Down