mirror of
https://github.com/gnustep/libs-base.git
synced 2025-06-01 09:02:01 +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;
|
void *tmp = 0;
|
||||||
int c;
|
int c;
|
||||||
off_t fileLength;
|
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__
|
#ifdef __ANDROID__
|
||||||
// Android: try using asset manager if path is in main bundle resources
|
// 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__ */
|
#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];
|
att = [mgr fileAttributesAtPath: path traverseLink: YES];
|
||||||
if (nil == att)
|
if (nil == att)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue