dirwalk.c: Add debug option to show opendir() failures
This commit is contained in:
parent
653f1a20c5
commit
8499dc57c5
1 changed files with 15 additions and 2 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
/*
|
/*
|
||||||
dirwalk.c
|
dirwalk.c
|
||||||
|
|
||||||
Copyright (c) 2009-2023
|
Copyright (c) 2009-2025
|
||||||
https://tuxpaint.org/
|
https://tuxpaint.org/
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or modify
|
This program is free software; you can redistribute it and/or modify
|
||||||
|
|
@ -19,9 +19,11 @@
|
||||||
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
(See COPYING.txt)
|
(See COPYING.txt)
|
||||||
|
|
||||||
Last modified: April 30, 2023
|
Last modified: February 22, 2025
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* #define DIRWALK_DEBUG */
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#ifndef __USE_GNU
|
#ifndef __USE_GNU
|
||||||
|
|
@ -354,6 +356,7 @@ void tp_ftw(SDL_Surface *screen, SDL_Texture *texture,
|
||||||
|
|
||||||
/* Open the directory: */
|
/* Open the directory: */
|
||||||
d = opendir(dir);
|
d = opendir(dir);
|
||||||
|
|
||||||
#ifdef __ANDROID__
|
#ifdef __ANDROID__
|
||||||
char *di;
|
char *di;
|
||||||
AAssetDir *adir;
|
AAssetDir *adir;
|
||||||
|
|
@ -365,11 +368,21 @@ void tp_ftw(SDL_Surface *screen, SDL_Texture *texture,
|
||||||
di = strndup(dir, dlen);
|
di = strndup(dir, dlen);
|
||||||
adir = open_asset_dir(di);
|
adir = open_asset_dir(di);
|
||||||
if (!adir)
|
if (!adir)
|
||||||
|
{
|
||||||
|
#ifdef DIRWALK_DEBUG
|
||||||
|
printf("tp_ftw() can't opendir(%s)\n", dir);
|
||||||
|
#endif
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if (!d)
|
if (!d)
|
||||||
|
{
|
||||||
|
#ifdef DIRWALK_DEBUG
|
||||||
|
printf("tp_ftw() can't opendir(%s)\n", dir);
|
||||||
|
#endif
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
for (;;)
|
for (;;)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue