Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
David MacDonald
purr-data
Commits
a5c94348
Commit
a5c94348
authored
Aug 14, 2017
by
Jonathan Wilkes
Browse files
handle special case of trailing "/" or "/~" in legacy external classnames
parent
99e673e0
Changes
1
Hide whitespace changes
Inline
Side-by-side
pd/src/s_loader.c
View file @
a5c94348
...
@@ -88,6 +88,27 @@ void sys_putonloadlist(const char *classname)
...
@@ -88,6 +88,27 @@ void sys_putonloadlist(const char *classname)
/* post("put on list %s", classname); */
/* post("put on list %s", classname); */
}
}
static
char
*
get_last_file_separator
(
const
char
*
objectname
)
{
char
*
c
=
strrchr
(
objectname
,
'/'
);
if
(
c
)
{
char
*
ret
=
c
;
/* if we're the last character before the null terminator,
OR if the end of the string is "/~", let's interpret the
slash as part of the class name.
*/
if
(
c
[
1
]
==
'\0'
||
(
c
[
1
]
==
'~'
&&
c
[
2
]
==
'\0'
))
{
*
c
=
'\0'
;
ret
=
strrchr
(
objectname
,
'/'
);
*
c
=
'/'
;
}
return
ret
;
}
return
NULL
;
}
void
class_set_extern_dir
(
t_symbol
*
s
);
void
class_set_extern_dir
(
t_symbol
*
s
);
static
int
sys_do_load_abs
(
t_canvas
*
canvas
,
const
char
*
objectname
,
static
int
sys_do_load_abs
(
t_canvas
*
canvas
,
const
char
*
objectname
,
...
@@ -108,7 +129,7 @@ static int sys_do_load_lib(t_canvas *canvas, const char *objectname,
...
@@ -108,7 +129,7 @@ static int sys_do_load_lib(t_canvas *canvas, const char *objectname,
but we have already tried all paths */
but we have already tried all paths */
if
(
!
path
)
return
(
0
);
if
(
!
path
)
return
(
0
);
if
((
classname
=
strrch
r
(
objectname
,
'/'
)))
if
((
classname
=
get_last_file_separato
r
(
objectname
)))
classname
++
;
classname
++
;
else
classname
=
objectname
;
else
classname
=
objectname
;
for
(
i
=
0
,
cnameptr
=
classname
;
i
<
MAXPDSTRING
-
7
&&
*
cnameptr
;
for
(
i
=
0
,
cnameptr
=
classname
;
i
<
MAXPDSTRING
-
7
&&
*
cnameptr
;
...
...
Write
Preview
Supports
Markdown
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