From b96ebc81eabfe1fe23116c5be99f9338283f72bf Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 31 Jan 2011 21:51:02 +0000 Subject: [PATCH] 2011-01-31 22:50 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * src/rtl/hbfilehi.prg + PATHNORMALIZE(): Will now strip double pathseps, except the UNC root ones. I hope. Pls make tests. --- harbour/ChangeLog | 5 +++++ harbour/src/rtl/hbfilehi.prg | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 839f378899..f2bf3bd495 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,11 @@ The license applies to all entries newer than 2009-04-28. */ +2011-01-31 22:50 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) + * src/rtl/hbfilehi.prg + + PATHNORMALIZE(): Will now strip double pathseps, except the + UNC root ones. I hope. Pls make tests. + 2011-01-31 22:33 UTC+0100 Viktor Szakats (harbour.01 syenar.hu) * ChangeLog ! Typo in prev. diff --git a/harbour/src/rtl/hbfilehi.prg b/harbour/src/rtl/hbfilehi.prg index 413f4b4ec1..39ef21be3d 100644 --- a/harbour/src/rtl/hbfilehi.prg +++ b/harbour/src/rtl/hbfilehi.prg @@ -74,7 +74,10 @@ FUNCTION hb_PathNormalize( cPath ) aDir := hb_ATokens( cPath, hb_ps() ) FOR EACH cDir IN aDir DESCEND - IF cDir == "." + IF cDir == "." .OR. ; + ( Empty( cDir ) .AND. ; + ( cDir:__enumIndex() > 2 .OR. ; + ( cDir:__enumIndex() == 2 .AND. ! Empty( aDir[ 1 ] ) ) ) ) hb_ADel( aDir, cDir:__enumIndex(), .T. ) ELSEIF !( cDir == ".." ) .AND. ; ! Empty( cDir ) .AND. ;