Skip to content

Commit

Permalink
Make paths in source comments relative to CWD
Browse files Browse the repository at this point in the history
  • Loading branch information
mgreter committed Oct 22, 2016
1 parent 57cb27a commit 9b9b8ff
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 9b9b8ff

Please sign in to comment.