diff options
Diffstat (limited to 'osdep/macosx_application.m')
-rw-r--r-- | osdep/macosx_application.m | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/osdep/macosx_application.m b/osdep/macosx_application.m index e57b6545b0..6d2d5e03e2 100644 --- a/osdep/macosx_application.m +++ b/osdep/macosx_application.m @@ -59,6 +59,27 @@ static pthread_t playback_thread_id; @synthesize keyFIFO = _key_fifo; @synthesize menuItems = _menu_items; +struct escape_couple { + NSString *in; + NSString *out; +}; + +static struct escape_couple escapes[] = { + { @"\\", @"\\\\" }, + { @"\"", @"\\\"" }, + { NULL, NULL } +}; + +static 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; +} + - (id)init { if (self = [super init]) { |