X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/012a01fc1ea0f4c870eaf66bb332617affa5abd0..9c34dd9deafaa428534b498b90799687a7dcddaa:/src/msw/filedlg.cpp

diff --git a/src/msw/filedlg.cpp b/src/msw/filedlg.cpp
index ac7478a9d8..94a4e60b58 100644
--- a/src/msw/filedlg.cpp
+++ b/src/msw/filedlg.cpp
@@ -310,8 +310,11 @@ int wxFileDialog::ShowModal()
                     if ( chNext != _T('\\') && chNext != _T('/') )
                         break;
 
-                    // ignore the next one
-                    i++;
+                    // ignore the next one, unless it is at the start of a UNC path
+                    if (i > 0)
+                        i++;
+                    else
+                        break;    
                 }
                 // fall through