Skip to content

Commit 335cd8f

Browse files
committed
fixed fpide search path
1 parent 758caca commit 335cd8f

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

Changelog.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
Version 7.0.3
2+
- Fixed .fpide search so file names are relative to the .fpide file
3+
14
Version 7.0.2
25
- Avoid a crash if a .fpide file is not found
36
- Fixed a problem with `loc #\imm` in inline asm

spinc.c

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1540,13 +1540,13 @@ ProcessOneIdeInc(char *def) {
15401540
#define MAX_IDE_FILES 256
15411541

15421542
static Module *
1543-
ParseIdeFile(Module *P, const char *name, int *is_dup_ptr)
1543+
ParseIdeFile(Module *P, const char *fpidename, int *is_dup_ptr)
15441544
{
15451545
FILE *F = NULL;
15461546
const char *ide_files[MAX_IDE_FILES] = { 0 };
15471547
int num_ide_files = 0;
15481548

1549-
if ( 0 != (F = OpenIdeFile(name)) ) {
1549+
if ( 0 != (F = OpenIdeFile(fpidename)) ) {
15501550
char fileBuf[256] = {0};
15511551
num_ide_files = 0;
15521552
while (fgets(fileBuf, sizeof(fileBuf)-1, F)) {
@@ -1582,10 +1582,15 @@ ParseIdeFile(Module *P, const char *name, int *is_dup_ptr)
15821582
// ignore, simple IDE includes header files in the .side file
15831583
} else {
15841584
if (num_ide_files == MAX_IDE_FILES) {
1585-
ERROR(NULL, "too many files in project file %s", name);
1585+
ERROR(NULL, "too many files in project file %s", fpidename);
15861586
} else {
15871587
// printf("File: [%s]\n", ptr);
1588-
ide_files[num_ide_files++] = strdup(ptr);
1588+
char *fullname = find_file_on_path(&gl_pp, ptr, NULL, fpidename);
1589+
if (fullname)
1590+
ptr = fullname;
1591+
else
1592+
ptr = strdup(ptr);
1593+
ide_files[num_ide_files++] = fullname;
15891594
}
15901595
}
15911596
}
@@ -1599,7 +1604,7 @@ ParseIdeFile(Module *P, const char *name, int *is_dup_ptr)
15991604
}
16001605
}
16011606
} else {
1602-
ERROR(NULL, "Unable to open file %s", name);
1607+
ERROR(NULL, "Unable to open file %s", fpidename);
16031608
}
16041609
return P;
16051610
}

0 commit comments

Comments
 (0)