delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/10/07/17:13:18

X-Spam-Check-By: sourceware.org
Date: Sat, 7 Oct 2006 23:15:47 +0200
From: Enrico Forestieri <forenr AT tlc DOT unipr DOT it>
To: cygwin AT cygwin DOT com
Cc: cygwin AT cygwin DOT com
Subject: Re: lyx has problem with network directory names
Message-ID: <20061007211547.GA1524@GIOVE>
References: <100720061436 DOT 26863 DOT 4527BB7E00013500000068EF22058861720A050E040D0C079D0A AT comcast DOT net>
Mime-Version: 1.0
In-Reply-To: <100720061436.26863.4527BB7E00013500000068EF22058861720A050E040D0C079D0A@comcast.net>
User-Agent: Mutt/1.4.2.1i
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

--G4iJoqBmSsgzjUCe
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Sat, Oct 07, 2006 at 02:36:46PM +0000, Eric Blake wrote:

> > > It appears that lyx is trying to access the root directory (/). It
> > > does not seem to know how to interpret the Windows syntax "//."
> > 
> > This is because lyx uses the boostfs library with BOOST_POSIX defined,
> > so any path of the form //xxx/yyy is normalized to /xxx/yyy.
> > I understand that //machine/path is a windowism, but I think that it
> > should be allowed on cygwin. Can this be seen a boost bug?
> 
> Yes, it is most definitely a boost bug and should be reported
> upstream.  POSIX allows implementations to treat leading //
> specially, so boost is violating POSIX by normalizing it.

Sorry for the noise, but boostfs seems innocent. I investigated
the problem and it turned out that qt3 is to be blamed here.
Indeed, UNC paths are accounted for only when Q_OS_WIN32 is defined.

The attached patch for qt 3.3.5 allows UNC paths on cygwin, too.

-- 
Enrico

--G4iJoqBmSsgzjUCe
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="qt3.diff"

diff -uNr qt3.orig/src/dialogs/qfiledialog.cpp qt3/src/dialogs/qfiledialog.cpp
--- qt3.orig/src/dialogs/qfiledialog.cpp	2005-09-30 17:58:32.000000000 +0200
+++ qt3/src/dialogs/qfiledialog.cpp	2006-10-07 22:54:36.000000000 +0200
@@ -5732,6 +5732,17 @@
      QString p = QDir::convertSeparators(u.path());
      if(p.contains(':') == 1)
 	return TRUE;
+#elif defined(Q_OS_CYGWIN)
+     QString p = u.path();
+     if ( p == "/" )
+	 return TRUE;
+     if ( p[0] == '/' && p[1] == '/' ) {
+	 int slashes = p.contains( '/' );
+	 if ( slashes <= 2 )
+	     return TRUE;
+	 if ( slashes == 3 && p[ (int)p.length() - 1 ] == '/' )
+	     return TRUE;
+     }
 #elif defined(Q_OS_UNIX)
     if ( u.path() == "/" )
 	return TRUE;
diff -uNr qt3.orig/src/kernel/qurl.cpp qt3/src/kernel/qurl.cpp
--- qt3.orig/src/kernel/qurl.cpp	2006-02-16 04:23:44.000000000 +0100
+++ qt3/src/kernel/qurl.cpp	2006-10-07 22:56:36.000000000 +0200
@@ -833,7 +833,7 @@
     if ( !d->host.isEmpty() && d->host[ 0 ] == '@' )
 	d->host.remove( (uint)0, 1 );
 
-#if defined(Q_OS_WIN32)
+#if defined(Q_OS_WIN32) || defined (Q_OS_CYGWIN)
     // hack for windows file://machine/path syntax
     if ( d->protocol == "file" ) {
 	if ( url.left( 7 ) == "file://" &&
@@ -1027,7 +1027,7 @@
 	if ( QDir::isRelativePath( d->path ) ) {
 	    d->cleanPath = d->path;
 	} else if ( isLocalFile() ) {
-#if defined(Q_OS_WIN32)
+#if defined(Q_OS_WIN32) || defined(Q_OS_CYGWIN)
 	    // hack for stuff like \\machine\path and //machine/path on windows
 	    if ( ( d->path.left( 1 ) == "/" || d->path.left( 1 ) == "\\" ) &&
 		 d->path.length() > 1 ) {
diff -uNr qt3.orig/src/tools/qdir.cpp qt3/src/tools/qdir.cpp
--- qt3.orig/src/tools/qdir.cpp	2006-02-15 19:26:24.000000000 +0100
+++ qt3/src/tools/qdir.cpp	2006-10-07 23:00:02.000000000 +0200
@@ -1293,6 +1293,9 @@
 	} else {
 	    newPath = name.left(2) + newPath;
 	}
+#elif defined(Q_OS_CYGWIN)
+	if ( name[0] == '/' && name[1] == '/' ) // "//machine/x/ ..."
+	    newPath.insert( 0, '/' );
 #endif
     }
     return newPath;


--G4iJoqBmSsgzjUCe
Content-Type: text/plain; charset=us-ascii

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/
--G4iJoqBmSsgzjUCe--

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019