Skip to content

Commit 9b9b8ff

Browse files
committed
Make paths in source comments relative to CWD
1 parent 57cb27a commit 9b9b8ff

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/file.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ namespace Sass {
218218
// create an absolute path by resolving relative paths with cwd
219219
std::string rel2abs(const std::string& path, const std::string& base, const std::string& cwd)
220220
{
221-
return make_canonical_path(join_paths(join_paths(cwd, base), path));
221+
return make_canonical_path(join_paths(join_paths(cwd + "/", base + "/"), path));
222222
}
223223

224224
// create a path that is relative to the given base directory

src/output.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,8 @@ namespace Sass {
129129
if (opt.source_comments) {
130130
std::stringstream ss;
131131
append_indentation();
132-
ss << "/* line " << r->pstate().line + 1 << ", " << r->pstate().path << " */";
132+
std::string path(File::abs2rel(r->pstate().path));
133+
ss << "/* line " << r->pstate().line + 1 << ", " << path << " */";
133134
append_string(ss.str());
134135
append_optional_linefeed();
135136
}

0 commit comments

Comments
 (0)