projects
/
goodguy
/
cinelerra.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
RafaMar updates for Spanish batch
[goodguy/cinelerra.git]
/
cinelerra-5.1
/
guicast
/
filesystem.C
diff --git
a/cinelerra-5.1/guicast/filesystem.C
b/cinelerra-5.1/guicast/filesystem.C
index ebc2007da9e145744e7d5b85dc05915ff79763f3..6017f6eaf7deeff4c9aa4d30a6ffa006398dd8f0 100644
(file)
--- a/
cinelerra-5.1/guicast/filesystem.C
+++ b/
cinelerra-5.1/guicast/filesystem.C
@@
-667,18
+667,12
@@
int FileSystem::extract_dir(char *out, const char *in)
int FileSystem::extract_name(char *out, const char *in, int test_dir)
{
int FileSystem::extract_name(char *out, const char *in, int test_dir)
{
- int i;
-
if(test_dir && is_dir(in))
out[0] = 0; // complete string is directory
if(test_dir && is_dir(in))
out[0] = 0; // complete string is directory
- else
- {
- for(i = strlen(in)-1; i > 0 && in[i] != '/'; i--)
- {
- ;
- }
- if(in[i] == '/') i++;
- strcpy(out, &in[i]);
+ else {
+ const char *cp = strrchr(in, '/');
+ const char *bp = !cp ? in : cp + 1;
+ strcpy(out, bp);
}
return 0;
}
}
return 0;
}