Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
node-sass
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
楚学文
node-sass
Commits
777a45d4
Commit
777a45d4
authored
Apr 12, 2012
by
Aaron Leung
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better include-path splitting and normalization.
parent
449aeeb3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
3 deletions
+15
-3
sass_interface.cpp
sass_interface.cpp
+14
-2
sassc.c
sassc.c
+1
-1
No files found.
sass_interface.cpp
View file @
777a45d4
...
@@ -23,18 +23,30 @@ extern "C" char* sass_compile(sass_context* c_ctx)
...
@@ -23,18 +23,30 @@ extern "C" char* sass_compile(sass_context* c_ctx)
const
size_t
wd_len
=
1024
;
const
size_t
wd_len
=
1024
;
char
wd
[
wd_len
];
char
wd
[
wd_len
];
cpp_ctx
.
include_paths
.
push_back
(
getcwd
(
wd
,
wd_len
));
cpp_ctx
.
include_paths
.
push_back
(
getcwd
(
wd
,
wd_len
));
if
(
*
cpp_ctx
.
include_paths
.
back
().
rbegin
()
!=
'/'
)
cpp_ctx
.
include_paths
.
back
()
+=
'/'
;
if
(
c_ctx
->
include_paths
)
{
if
(
c_ctx
->
include_paths
)
{
const
char
*
beg
=
c_ctx
->
include_paths
;
const
char
*
beg
=
c_ctx
->
include_paths
;
const
char
*
end
=
Prelexer
::
find_first
<
':'
>
(
beg
);
const
char
*
end
=
Prelexer
::
find_first
<
':'
>
(
beg
);
while
(
end
)
{
while
(
end
)
{
cpp_ctx
.
include_paths
.
push_back
(
string
(
beg
,
end
-
beg
));
string
path
(
beg
,
end
-
beg
);
if
(
!
path
.
empty
())
{
if
(
*
path
.
rbegin
()
!=
'/'
)
path
+=
'/'
;
cpp_ctx
.
include_paths
.
push_back
(
path
);
}
beg
=
end
+
1
;
beg
=
end
+
1
;
end
=
Prelexer
::
find_first
<
':'
>
(
beg
);
end
=
Prelexer
::
find_first
<
':'
>
(
beg
);
}
}
cpp_ctx
.
include_paths
.
push_back
(
beg
);
string
path
(
beg
);
if
(
!
path
.
empty
())
{
if
(
*
path
.
rbegin
()
!=
'/'
)
path
+=
'/'
;
cpp_ctx
.
include_paths
.
push_back
(
path
);
}
for
(
int
i
=
0
;
i
<
cpp_ctx
.
include_paths
.
size
();
++
i
)
{
cerr
<<
cpp_ctx
.
include_paths
[
i
]
<<
endl
;
}
}
}
Document
doc
(
c_ctx
->
input_file
,
c_ctx
->
input_string
,
cpp_ctx
);
Document
doc
(
c_ctx
->
input_file
,
c_ctx
->
input_string
,
cpp_ctx
);
...
...
sassc.c
View file @
777a45d4
...
@@ -30,7 +30,7 @@ int main(int argc, char** argv)
...
@@ -30,7 +30,7 @@ int main(int argc, char** argv)
struct
sass_context
*
ctx
=
sass_new_context
();
struct
sass_context
*
ctx
=
sass_new_context
();
ctx
->
sass_path
=
NULL
;
ctx
->
sass_path
=
NULL
;
ctx
->
css_path
=
NULL
;
ctx
->
css_path
=
NULL
;
ctx
->
include_paths
=
NULL
;
ctx
->
include_paths
=
"::/blah/bloo/fuzz:/slub/flub/chub::/Users/Aaron/dev/libsass/::::/huzz/buzz:::"
;
ctx
->
output_style
=
0
;
ctx
->
output_style
=
0
;
ctx
->
input_file
=
argv
[
1
];
ctx
->
input_file
=
argv
[
1
];
ctx
->
input_string
=
NULL
;
ctx
->
input_string
=
NULL
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment