mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 00:11:26 +00:00
Moved Android asset reading code path in NSData.
No reason to get path file system representation first.
This commit is contained in:
parent
3b60b1a8be
commit
ba4948fd97
1 changed files with 11 additions and 11 deletions
|
@ -242,17 +242,6 @@ readContentsOfFile(NSString *path, void **buf, off_t *len, NSZone *zone)
|
|||
void *tmp = 0;
|
||||
int c;
|
||||
off_t fileLength;
|
||||
|
||||
#if defined(_WIN32)
|
||||
thePath = (const unichar*)[path fileSystemRepresentation];
|
||||
#else
|
||||
thePath = [path fileSystemRepresentation];
|
||||
#endif
|
||||
if (thePath == 0)
|
||||
{
|
||||
NSWarnFLog(@"Open (%@) attempt failed - bad path", path);
|
||||
return NO;
|
||||
}
|
||||
|
||||
#ifdef __ANDROID__
|
||||
// Android: try using asset manager if path is in main bundle resources
|
||||
|
@ -283,6 +272,17 @@ readContentsOfFile(NSString *path, void **buf, off_t *len, NSZone *zone)
|
|||
}
|
||||
#endif /* __ANDROID__ */
|
||||
|
||||
#if defined(_WIN32)
|
||||
thePath = (const unichar*)[path fileSystemRepresentation];
|
||||
#else
|
||||
thePath = [path fileSystemRepresentation];
|
||||
#endif
|
||||
if (thePath == 0)
|
||||
{
|
||||
NSWarnFLog(@"Open (%@) attempt failed - bad path", path);
|
||||
return NO;
|
||||
}
|
||||
|
||||
att = [mgr fileAttributesAtPath: path traverseLink: YES];
|
||||
if (nil == att)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue