Skip to content
This repository was archived by the owner on Oct 24, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Libsass
by Aaron Leung ([@akhleung]) and Hampton Catlin ([@hcatlin])

[![Linux CI](https://travis-ci.org/sass/libsass.png?branch=master)](https://travis-ci.org/sass/libsass)
[![Windows CI](https://ci.appveyor.com/api/projects/status/s88o0u5qra2ng4vy/branch/master?svg=true)](https://ci.appveyor.com/project/sass/libsass/branch/master)
[![Windows CI](https://ci.appveyor.com/api/projects/status/github/sass/libsass?svg=true)](https://ci.appveyor.com/project/sass/libsass/branch/master)
[![Bountysource](https://www.bountysource.com/badge/tracker?tracker_id=283068)](https://www.bountysource.com/trackers/283068-libsass?utm_source=283068&utm_medium=shield&utm_campaign=TRACKER_BADGE)
[![Coverage Status](https://img.shields.io/coveralls/sass/libsass.svg)](https://coveralls.io/r/sass/libsass?branch=feature%2Ftest-travis-ci-3)

Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ cache:
- C:\Ruby21-x64\bin

install:
- git clone https://github.com/mgreter/sassc.git --branch feature/build-dll-win-mingw
- git clone https://github.com/sass/sassc.git
- git clone https://github.com/sass/sass-spec.git
- set PATH=C:\Ruby%ruby_version%\bin;%PATH%
- set SASS_LIBSASS_PATH=..
Expand Down
19 changes: 14 additions & 5 deletions sass_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,7 @@ extern "C" {
void* root;
};

static void copy_options(struct Sass_Options* to, struct Sass_Options* from) { *to = *from; }

#define IMPLEMENT_SASS_OPTION_ACCESSOR(type, option) \
type ADDCALL sass_option_get_##option (struct Sass_Options* options) { return options->option; } \
Expand Down Expand Up @@ -498,7 +499,11 @@ extern "C" {
if (c_ctx->error_status)
return c_ctx->error_status;
Context::Data cpp_opt = Context::Data();
try { cpp_opt.source_c_str(data_ctx->source_string); }
try {
if (data_ctx->source_string == 0) { throw(runtime_error("Data context has no source string")); }
if (*data_ctx->source_string == 0) { throw(runtime_error("Data context has empty source string")); }
cpp_opt.source_c_str(data_ctx->source_string);
}
catch (...) { return handle_errors(c_ctx) || 1; }
return sass_compile_context(c_ctx, cpp_opt);
}
Expand All @@ -510,7 +515,11 @@ extern "C" {
if (c_ctx->error_status)
return c_ctx->error_status;
Context::Data cpp_opt = Context::Data();
try { cpp_opt.entry_point(file_ctx->input_path); }
try {
if (file_ctx->input_path == 0) { throw(runtime_error("File context has no input path")); }
if (*file_ctx->input_path == 0) { throw(runtime_error("File context has empty input path")); }
cpp_opt.entry_point(file_ctx->input_path);
}
catch (...) { return handle_errors(c_ctx) || 1; }
return sass_compile_context(c_ctx, cpp_opt);
}
Expand Down Expand Up @@ -567,7 +576,7 @@ extern "C" {
++this_func_data;
}
}
// Deallocate inc paths
// Free custom importer
if (options->include_paths) {
struct string_list* cur;
struct string_list* next;
Expand Down Expand Up @@ -643,8 +652,8 @@ extern "C" {
struct Sass_Options* ADDCALL sass_context_get_options(struct Sass_Context* ctx) { return ctx; }
struct Sass_Options* ADDCALL sass_file_context_get_options(struct Sass_File_Context* ctx) { return ctx; }
struct Sass_Options* ADDCALL sass_data_context_get_options(struct Sass_Data_Context* ctx) { return ctx; }
void ADDCALL sass_file_context_set_options (struct Sass_File_Context* ctx, struct Sass_Options* opt) { (Sass_Options) *ctx = *opt; }
void ADDCALL sass_data_context_set_options (struct Sass_Data_Context* ctx, struct Sass_Options* opt) { (Sass_Options) *ctx = *opt; }
void ADDCALL sass_file_context_set_options (struct Sass_File_Context* ctx, struct Sass_Options* opt) { copy_options(ctx, opt); }
void ADDCALL sass_data_context_set_options (struct Sass_Data_Context* ctx, struct Sass_Options* opt) { copy_options(ctx, opt); }

// Create getter and setters for options
IMPLEMENT_SASS_OPTION_ACCESSOR(int, precision);
Expand Down