From: Glenn Morris Date: Mon, 9 Jul 2012 21:14:12 +0000 (-0400) Subject: * src/nsterm.m, src/nsterm.h (ns_etc_directory): Fix type, empty return. X-Git-Tag: emacs-24.2.90~1199^2~110 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7c4e8ec014e532c3864a7e2494d71a663d96b295;p=emacs.git * src/nsterm.m, src/nsterm.h (ns_etc_directory): Fix type, empty return. --- diff --git a/src/ChangeLog b/src/ChangeLog index f0f060268c4..c4911968e0d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2012-07-09 Glenn Morris + + * nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return. + 2012-07-09 Paul Eggert * process.c (wait_reading_process_output): 'waitchannels' was unset diff --git a/src/nsterm.h b/src/nsterm.h index b2f03d08f2c..969091e334c 100644 --- a/src/nsterm.h +++ b/src/nsterm.h @@ -798,7 +798,7 @@ extern void x_free_frame_resources (struct frame *); #define NSAPP_DATA2_RUNASSCRIPT 10 extern void ns_run_ascript (void); -extern char *ns_etc_directory (void); +extern const char *ns_etc_directory (void); extern void ns_init_paths (void); extern void syms_of_nsterm (void); extern void syms_of_nsfns (void); diff --git a/src/nsterm.m b/src/nsterm.m index 4c4d3de78ff..2b1b67c8b58 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -286,24 +286,24 @@ append2 (Lisp_Object list, Lisp_Object item) } -char * +const char * ns_etc_directory (void) { /* If running as a self-contained app bundle, return as a string the filename of the etc directory, if present; else nil. */ - NSBundle *bundle = [NSBundle mainBundle]; - NSString *resourceDir = [bundle resourcePath]; - NSString *resourcePath; - NSFileManager *fileManager = [NSFileManager defaultManager]; - BOOL isDir; - - resourcePath = [resourceDir stringByAppendingPathComponent: @"etc"]; - if ([fileManager fileExistsAtPath: resourcePath isDirectory: &isDir]) - { - if (isDir) return [resourcePath UTF8String]; - } - return nil; + NSBundle *bundle = [NSBundle mainBundle]; + NSString *resourceDir = [bundle resourcePath]; + NSString *resourcePath; + NSFileManager *fileManager = [NSFileManager defaultManager]; + BOOL isDir; + + resourcePath = [resourceDir stringByAppendingPathComponent: @"etc"]; + if ([fileManager fileExistsAtPath: resourcePath isDirectory: &isDir]) + { + if (isDir) return [resourcePath UTF8String]; + } + return NULL; } void