Skip to content

Commit

Permalink
Merge pull request #2219 from mgreter/bugfix/issue-1898
Browse files Browse the repository at this point in the history
Make paths in source comments relative to CWD
  • Loading branch information
mgreter authored Oct 22, 2016
2 parents 6ded0d0 + 9b9b8ff commit 967f297
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ namespace Sass {
// create an absolute path by resolving relative paths with cwd
std::string rel2abs(const std::string& path, const std::string& base, const std::string& cwd)
{
return make_canonical_path(join_paths(join_paths(cwd, base), path));
return make_canonical_path(join_paths(join_paths(cwd + "/", base + "/"), path));
}

// create a path that is relative to the given base directory
Expand Down
3 changes: 2 additions & 1 deletion src/output.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,8 @@ namespace Sass {
if (opt.source_comments) {
std::stringstream ss;
append_indentation();
ss << "/* line " << r->pstate().line + 1 << ", " << r->pstate().path << " */";
std::string path(File::abs2rel(r->pstate().path));
ss << "/* line " << r->pstate().line + 1 << ", " << path << " */";
append_string(ss.str());
append_optional_linefeed();
}
Expand Down

0 comments on commit 967f297

Please sign in to comment.