Skip to content

Commit

Permalink
Add diagnositcs for faulure to get executable pathhhhhhhhhhhhhhhhhhhh…
Browse files Browse the repository at this point in the history
…hhhhh
  • Loading branch information
rfm committed Dec 6, 2024
1 parent e231fe2 commit a75d1c7
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 6 deletions.
36 changes: 32 additions & 4 deletions Source/NSBundle.m
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,8 @@ + (NSString**) frameworkClasses;
[load_lock lock];
if (beenHere == NO)
{
NSString *tmp;

#if defined(PROCFS_EXE_LINK)
executablePath = [manager()
pathContentOfSymbolicLinkAtPath:
Expand All @@ -376,19 +378,45 @@ + (NSString**) frameworkClasses;
executablePath = nil;
}
#endif
if (executablePath == nil || [executablePath length] == 0)
if ([executablePath length] == 0)
{
executablePath
= [[[NSProcessInfo processInfo] arguments] objectAtIndex: 0];
if ([executablePath length] == 0)
{
fprintf(stderr,
"Unable to get executable path from NSProcessInfo.\n");
}
}
if (NO == [executablePath isAbsolutePath])
{
executablePath = AbsolutePathOfExecutable(executablePath, YES);
tmp = executablePath;
executablePath = AbsolutePathOfExecutable(tmp, YES);
if ([executablePath length] == 0)
{
fprintf(stderr,
"Unable to get absolute value of executable path '%s'.\n",
[tmp UTF8String]);
}
}
else
{
executablePath = [executablePath stringByResolvingSymlinksInPath];
executablePath = [executablePath stringByStandardizingPath];
tmp = executablePath;
executablePath = [tmp stringByResolvingSymlinksInPath];
if ([executablePath length] == 0)
{
fprintf(stderr,
"Unable to get resolve links in executable path '%s'.\n",
[tmp UTF8String]);
}
tmp = executablePath;
executablePath = [tmp stringByStandardizingPath];
if ([executablePath length] == 0)
{
fprintf(stderr,
"Unable to standardize executable path '%s'.\n",
[tmp UTF8String]);
}
}
IF_NO_ARC([executablePath retain];)
beenHere = YES;
Expand Down
5 changes: 3 additions & 2 deletions Source/NSUserDefaults.m
Original file line number Diff line number Diff line change
Expand Up @@ -2345,8 +2345,9 @@ - (void) removeSuiteNamed: (NSString*)aName
{
if (initializing)
{
fprintf(stderr, "GSPrivateDefaultsFlag() called within"
" +[NSUserDefaults initialize] always returns NO.\n");
fprintf(stderr, "GSPrivateDefaultsFlag(%d) called within"
" +[NSUserDefaults initialize] always returns NO.\n",
(int)type);
}
else
{
Expand Down

0 comments on commit a75d1c7

Please sign in to comment.