Browse Source

Avoiding ambiguity with global variable

Source commit: 15a7c176142a3644b7f86f93cb016626987c1744
Martin Prikryl 4 years ago
parent
commit
229063ae04
1 changed files with 7 additions and 7 deletions
  1. 7 7
      source/packages/filemng/DriveView.pas

+ 7 - 7
source/packages/filemng/DriveView.pas

@@ -1042,7 +1042,7 @@ var
   Drive: string;
   OldSerial: DWORD;
   NewDir: string;
-  LastDrive: string;
+  PrevDrive: string;
 begin
   if not Reading and not (csRecreating in ControlState) then
   begin
@@ -1053,9 +1053,9 @@ begin
       begin
         Drive := DriveInfo.GetDriveKey(NewDir);
         if Length(FLastDir) > 0 then
-          LastDrive := DriveInfo.GetDriveKey(FLastDir)
+          PrevDrive := DriveInfo.GetDriveKey(FLastDir)
         else
-          LastDrive := '';
+          PrevDrive := '';
 
         FChangeFlag := True;
         FLastDir := NewDir;
@@ -1077,12 +1077,12 @@ begin
 
             GetDriveStatus(Drive).DefaultDir := IncludeTrailingBackslash(NewDir);
 
-            if LastDrive <> Drive then
+            if PrevDrive <> Drive then
             begin
-              if (LastDrive <> '') and
-                 (DriveInfo.Get(LastDrive).DriveType = DRIVE_REMOVABLE) then
+              if (PrevDrive <> '') and
+                 (DriveInfo.Get(PrevDrive).DriveType = DRIVE_REMOVABLE) then
               begin
-                TerminateWatchThread(LastDrive);
+                TerminateWatchThread(PrevDrive);
               end;
 
               {Drive serial has changed or is missing: allways reread the drive:}