mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-03 05:00:09 +01:00
progs: Try to read the texture from the current dir, if full path fails.
This commit is contained in:
parent
ed7bb2c196
commit
e5a3aa5672
1 changed files with 9 additions and 3 deletions
|
|
@ -102,9 +102,15 @@ static rawImageRec *RawImageOpen(const char *fileName)
|
|||
fprintf(stderr, "Out of memory!\n");
|
||||
return NULL;
|
||||
}
|
||||
if ((raw->file = fopen(fileName, "rb")) == NULL) {
|
||||
perror(fileName);
|
||||
return NULL;
|
||||
raw->file = fopen(fileName, "rb");
|
||||
if (raw->file == NULL) {
|
||||
const char *baseName = strrchr(fileName, '/');
|
||||
if(baseName)
|
||||
raw->file = fopen(baseName + 1, "rb");
|
||||
if(raw->file == NULL) {
|
||||
perror(fileName);
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
fread(raw, 1, 12, raw->file);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue