* src/nsterm.m, src/nsterm.h (ns_etc_directory): Fix type, empty return.

This commit is contained in:
Glenn Morris 2012-07-09 17:14:12 -04:00
parent a0bee46f5a
commit 7c4e8ec014
3 changed files with 17 additions and 13 deletions

View file

@ -1,3 +1,7 @@
2012-07-09 Glenn Morris <rgm@gnu.org>
* nsterm.m, nsterm.h (ns_etc_directory): Fix type, empty return.
2012-07-09 Paul Eggert <eggert@cs.ucla.edu>
* process.c (wait_reading_process_output): 'waitchannels' was unset

View file

@ -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);

View file

@ -286,24 +286,24 @@ Updated by Christian Limpach (chris@nice.ch)
}
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;
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;
resourcePath = [resourceDir stringByAppendingPathComponent: @"etc"];
if ([fileManager fileExistsAtPath: resourcePath isDirectory: &isDir])
{
if (isDir) return [resourcePath UTF8String];
}
return NULL;
}
void