summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomas Bzatek <tbzatek@users.sourceforge.net>2010-02-14 08:58:52 +0100
committerTomas Bzatek <tbzatek@users.sourceforge.net>2010-02-14 08:58:52 +0100
commit55605a80092452ce593cb05df12a404ad47aa808 (patch)
treef3eb0ab4615f473ae3098657ab6e84fd5cc54481
parent8f1ad519dd5ae1d17f625044bf18c3d8e77acea5 (diff)
downloadtuxcmd-55605a80092452ce593cb05df12a404ad47aa808.tar.xz
Don't show negative free space
-rw-r--r--UEngines.pas4
-rw-r--r--UMain.pas3
2 files changed, 5 insertions, 2 deletions
diff --git a/UEngines.pas b/UEngines.pas
index 66dd9ea..3db0c25 100644
--- a/UEngines.pas
+++ b/UEngines.pas
@@ -718,8 +718,8 @@ var Stat: Pstatfs64;
FoundLength: integer;
Buffer: array[0..31] of char;
begin
- FSSize := 0;
- FSFree := 0;
+ FSSize := -1;
+ FSFree := -1;
FSName := '';
try
Stat := malloc(sizeof(Tstatfs64));
diff --git a/UMain.pas b/UMain.pas
index 9e04293..56198fc 100644
--- a/UMain.pas
+++ b/UMain.pas
@@ -1950,6 +1950,9 @@ begin
else s := RightPathLabel.Caption;
CommandLineLabel.Caption := Format('%s@%s:%s>', [GetUserName, GetHostName, s]);
LeftPanelEngine.GetFileSystemInfo(LeftPanelEngine.Path, FSSize, FSFree, FSName);
+ // *TODO: hide numbers if filesystem info cannot be determined
+ if FSSize < 0 then FSSize := 0;
+ if FSFree < 0 then FSFree := 0;
if FSName <> ''
then LeftDiskInfoLabel.Caption := Format(LANGDiskStatVolNameFmt, [FSName,
FormatSize(FSFree, 1024),