diff options
Diffstat (limited to 'video/out/osx_common.m')
-rw-r--r-- | video/out/osx_common.m | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/video/out/osx_common.m b/video/out/osx_common.m index 58198c11e2..2d22fc52dc 100644 --- a/video/out/osx_common.m +++ b/video/out/osx_common.m @@ -152,3 +152,24 @@ cleanup_and_return: [pool release]; return rv; } + +struct escape_couple { + NSString *in; + NSString *out; +}; + +static struct escape_couple escapes[] = { + { @"\\", @"\\\\" }, + { @"\"", @"\\\"" }, + { NULL, NULL } +}; + +NSString *escape_loadfile_name(NSString *input) +{ + for (int i = 0; escapes[i].out; i++) { + input = [input stringByReplacingOccurrencesOfString:escapes[i].in + withString:escapes[i].out]; + } + + return input; +} |