summary refs log tree commit diff stats
path: root/nim/pragmas.pas
diff options
context:
space:
mode:
Diffstat (limited to 'nim/pragmas.pas')
-rwxr-xr-xnim/pragmas.pas11
1 files changed, 5 insertions, 6 deletions
diff --git a/nim/pragmas.pas b/nim/pragmas.pas
index e8d07d52d..8411a319f 100755
--- a/nim/pragmas.pas
+++ b/nim/pragmas.pas
@@ -415,24 +415,23 @@ type
 
 procedure processCompile(c: PContext; n: PNode);
 var
-  s, found, trunc, ext: string;
+  s, found, trunc: string;
 begin
   s := expectStrLit(c, n);
   found := findFile(s);
   if found = '' then found := s;
-  splitFilename(found, trunc, ext);
+  trunc := ChangeFileExt(found, '');
   extccomp.addExternalFileToCompile(trunc);
   extccomp.addFileToLink(completeCFilePath(trunc, false));
 end;
 
 procedure processCommonLink(c: PContext; n: PNode; feature: TLinkFeature);
 var
-  f, tmp, ext, found: string;
+  f, found: string;
 begin
   f := expectStrLit(c, n);
-  splitFilename(f, tmp, ext);
-  if (ext = '') then
-    f := toObjFile(tmp);
+  if splitFile(f).ext = '' then
+    f := toObjFile(f);
   found := findFile(f);
   if found = '' then
     found := f; // use the default