Commit 7c4e8ec0 authored by Glenn Morris's avatar Glenn Morris

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

parent a0bee46f
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
......
......@@ -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);
......
......@@ -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;
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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment