Browse Source

* fix for bugs 1084/1128 (merged)

pierre 25 years ago
parent
commit
2fb3b8d9e2
1 changed files with 13 additions and 8 deletions
  1. 13 8
      compiler/symppu.inc

+ 13 - 8
compiler/symppu.inc

@@ -536,6 +536,7 @@
     procedure readsourcefiles;
     procedure readsourcefiles;
       var
       var
         temp,hs       : string;
         temp,hs       : string;
+        temp_dir      : string;
 {$ifdef ORDERSOURCES}
 {$ifdef ORDERSOURCES}
         main_dir      : string;
         main_dir      : string;
 {$endif ORDERSOURCES}
 {$endif ORDERSOURCES}
@@ -558,7 +559,7 @@
 {$ifndef ORDERSOURCES}
 {$ifndef ORDERSOURCES}
            is_main:=current_ppu^.endofentry;
            is_main:=current_ppu^.endofentry;
 {$endif ORDERSOURCES}
 {$endif ORDERSOURCES}
-           temp:='';
+           temp_dir:='';
            if (current_module^.flags and uf_in_library)<>0 then
            if (current_module^.flags and uf_in_library)<>0 then
             begin
             begin
               current_module^.sources_avail:=false;
               current_module^.sources_avail:=false;
@@ -575,6 +576,7 @@
               { check the date of the source files }
               { check the date of the source files }
               Source_Time:=GetNamedFileTime(current_module^.path^+hs);
               Source_Time:=GetNamedFileTime(current_module^.path^+hs);
               incfile_found:=false;
               incfile_found:=false;
+              main_found:=false;
               if Source_Time<>-1 then
               if Source_Time<>-1 then
                 hs:=current_module^.path^+hs
                 hs:=current_module^.path^+hs
 {$ifdef ORDERSOURCES}
 {$ifdef ORDERSOURCES}
@@ -589,12 +591,12 @@
               if (Source_Time=-1) then
               if (Source_Time=-1) then
                 begin
                 begin
                   if is_main then
                   if is_main then
-                    temp:=unitsearchpath.FindFile(hs,main_found)
+                    temp_dir:=unitsearchpath.FindFile(hs,main_found)
                   else
                   else
-                    temp:=includesearchpath.FindFile(hs,incfile_found);
+                    temp_dir:=includesearchpath.FindFile(hs,incfile_found);
                   if incfile_found or main_found then
                   if incfile_found or main_found then
                    begin
                    begin
-                     hs:=temp+hs;
+                     hs:=temp_dir+hs;
                      Source_Time:=GetNamedFileTime(hs);
                      Source_Time:=GetNamedFileTime(hs);
                    end
                    end
                 end;
                 end;
@@ -605,6 +607,8 @@
                end
                end
               else
               else
                begin
                begin
+                 if main_found then
+                   main_dir:=temp_dir;
                  { time newer? But only allow if the file is not searched
                  { time newer? But only allow if the file is not searched
                    in the include path (PFV), else you've problems with
                    in the include path (PFV), else you've problems with
                    units which use the same includefile names }
                    units which use the same includefile names }
@@ -630,8 +634,6 @@
              begin
              begin
                stringdispose(current_module^.mainsource);
                stringdispose(current_module^.mainsource);
                current_module^.mainsource:=stringdup(hs);
                current_module^.mainsource:=stringdup(hs);
-               if main_found then
-                 main_dir:=temp;
              end;
              end;
 {$endif ORDERSOURCES}
 {$endif ORDERSOURCES}
            Message1(unit_u_ppu_source,hs+temp);
            Message1(unit_u_ppu_source,hs+temp);
@@ -734,7 +736,10 @@
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.2  2000-07-13 11:32:49  michael
+  Revision 1.3  2000-09-21 20:56:19  pierre
+   * fix for bugs 1084/1128 (merged)
+
+  Revision 1.2  2000/07/13 11:32:49  michael
   + removed logs
   + removed logs
- 
+
 }
 }