Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Icecast-Server
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
93
Issues
93
List
Boards
Labels
Service Desk
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
External Wiki
External Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xiph.Org
Icecast-Server
Commits
e870c213
Commit
e870c213
authored
Mar 01, 2015
by
Philipp Schafft
🦁
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup: some style corrections.
parent
e0c05ef8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
9 deletions
+20
-9
src/xslt.c
src/xslt.c
+20
-9
No files found.
src/xslt.c
View file @
e870c213
...
...
@@ -202,21 +202,24 @@ static xmlDocPtr custom_loader(const xmlChar *URI,
void
*
ctxt
,
xsltLoadType
type
)
{
int
len
;
xmlDocPtr
ret
;
xmlChar
*
rel_path
,
*
fn
,
*
final_URI
=
NULL
;
xsltStylesheet
*
c
;
ice_config_t
*
conf
;
ice_config_t
*
config
;
switch
(
type
)
{
/* In case an include is loaded */
case
XSLT_LOAD_STYLESHEET
:
/* Not look in admindir if the include file exists */
if
(
access
((
char
*
)
URI
,
F_OK
)
==
0
)
if
(
access
((
c
onst
c
har
*
)
URI
,
F_OK
)
==
0
)
break
;
c
=
(
xsltStylesheet
*
)
ctxt
;
/* Check if we actually have context/path */
if
(
ctxt
==
NULL
||
c
->
doc
->
URL
==
NULL
)
break
;
/* Construct the right path */
rel_path
=
xmlBuildRelativeURI
(
URI
,
c
->
doc
->
URL
);
if
(
rel_path
!=
NULL
&&
admin_path
!=
NULL
)
{
...
...
@@ -224,6 +227,7 @@ static xmlDocPtr custom_loader(const xmlChar *URI,
final_URI
=
fn
;
xmlFree
(
rel_path
);
}
/* Fail if there was an error constructing the path */
if
(
final_URI
==
NULL
)
{
if
(
rel_path
)
...
...
@@ -233,25 +237,32 @@ static xmlDocPtr custom_loader(const xmlChar *URI,
break
;
/* In case a top stylesheet is loaded */
case
XSLT_LOAD_START
:
conf
=
config_get_config
();
len
=
strlen
(
conf
->
adminroot_dir
);
conf
ig
=
config_get_config
();
/* Check if admin path actually changed. If so clear it. */
if
(
admin_path
!=
NULL
&&
str
ncmp
(
conf
->
adminroot_dir
,
(
char
*
)
admin_path
,
len
)
!=
0
)
{
str
cmp
(
config
->
adminroot_dir
,
(
char
*
)
admin_path
)
!=
0
)
{
xmlFree
(
admin_path
);
admin_path
=
NULL
;
}
if
(
admin_path
==
NULL
)
{
/* Do we need to load the admin path? */
if
(
!
admin_path
)
{
size_t
len
=
strlen
(
config
->
adminroot_dir
);
admin_path
=
xmlMemMalloc
(
len
+
2
);
if
(
admin_path
==
NULL
)
if
(
!
admin_path
)
return
NULL
;
xmlStrPrintf
(
admin_path
,
len
+
2
,
XMLSTR
(
"%s/"
),
XMLSTR
(
conf
->
adminroot_dir
));
/* Copy over admin path and add a tailing slash. */
xmlStrPrintf
(
admin_path
,
len
+
2
,
XMLSTR
(
"%s/"
),
XMLSTR
(
config
->
adminroot_dir
));
}
config_release_config
();
break
;
/* Avoid warnings about other events we don't care for */
default:
break
;
}
/* Get the actual xmlDoc */
if
(
final_URI
)
{
ret
=
xslt_loader
(
final_URI
,
dict
,
options
,
ctxt
,
type
);
...
...
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