Browse Source

* Fixed expanding ~ if there is no HOME env var set.

git-svn-id: branches/targetandroid@23400 -
yury 12 years ago
parent
commit
8333a4d000
1 changed files with 5 additions and 1 deletions
  1. 5 1
      rtl/inc/fexpand.inc

+ 5 - 1
rtl/inc/fexpand.inc

@@ -163,7 +163,11 @@ begin
  {$ENDIF FPC_FEXPAND_SYSUTILS}
  {$ENDIF FPC_FEXPAND_SYSUTILS}
             if (S = '') or (Length (S) = 1)
             if (S = '') or (Length (S) = 1)
                                           and (S [1] = DirectorySeparator) then
                                           and (S [1] = DirectorySeparator) then
-                Delete (Pa, 1, 1)
+                begin
+                    Delete (Pa, 1, 1);
+                    if Copy(Pa, 1, 1) = DirectorySeparator then
+                        Delete (Pa, 1, 1);
+                end
             else
             else
                 if S [Length (S)] = DirectorySeparator then
                 if S [Length (S)] = DirectorySeparator then
                     Pa := S + Copy (Pa, 3, Length (Pa) - 2)
                     Pa := S + Copy (Pa, 3, Length (Pa) - 2)