aboutsummaryrefslogtreecommitdiff
path: root/src/tof.h
diff options
context:
space:
mode:
authorThomas O Fredericks <mrtof@users.sourceforge.net>2009-10-07 20:06:41 +0000
committerThomas O Fredericks <mrtof@users.sourceforge.net>2009-10-07 20:06:41 +0000
commit9728c280040625fd4eff572b71b3cb6c8495206b (patch)
treea8570fd6580501499a646fafd3df4632df6fb665 /src/tof.h
parentcd658ffed1329080f06f84e890dcda4302ca5864 (diff)
fixed a problem having to do with absolute and relative paths
svn path=/trunk/externals/tof/; revision=12555
Diffstat (limited to 'src/tof.h')
-rw-r--r--src/tof.h23
1 files changed, 5 insertions, 18 deletions
diff --git a/src/tof.h b/src/tof.h
index 2f51630..3698b52 100644
--- a/src/tof.h
+++ b/src/tof.h
@@ -39,21 +39,6 @@ static t_symbol* tof_get_dollarzero(t_canvas* canvas) {
}
-static int tof_path_is_absolute(char *dir, int length)
-{
- if ((length && dir[0] == '/') || (dir[0] == '~')
-#ifdef MSW
- || dir[0] == '%' || (length > 2 && (dir[1] == ':' && dir[2] == '/'))
-#endif
- )
- {
- return 1;
- } else {
- return 0;
- }
-}
-
-
static int tof_canvas_is_not_subpatch(t_canvas* canvas) {
return canvas_isabstraction(canvas);
@@ -281,13 +266,15 @@ static void tof_send_anything_prepend(t_symbol* target,t_symbol* s, int ac, t_at
static t_symbol* tof_remove_extension(t_symbol* s) {
- t_symbol* newsymbol;
+ t_symbol* newsymbol = s;
int length = strlen(s->s_name) + 1;
char* newstring = getbytes(length * sizeof(*newstring));
strcpy(newstring,s->s_name);
char* last = strrchr( newstring, '.');
- *last = '\0';
- newsymbol = gensym(newstring);
+ if (last != NULL) {
+ *last = '\0';
+ newsymbol = gensym(newstring);
+ }
freebytes(newstring,length * sizeof(*newstring));
return newsymbol;
}