delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/08/22/08:11:44

X-Recipient: archive-cygwin AT delorie DOT com
X-SWARE-Spam-Status: No, hits=-1.2 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_52
X-Spam-Check-By: sourceware.org
Message-ID: <4A8FE066.1050306@x-ray.at>
Date: Sat, 22 Aug 2009 14:11:18 +0200
From: Reini Urban <rurban AT x-ray DOT at>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de-AT; rv:1.8.1.22) Gecko/20090605 SeaMonkey/1.1.17
MIME-Version: 1.0
To: cygwin AT cygwin DOT com
Subject: Re: sqlite3 fixes for cygwin-1.7
References: <6910a60908210020i6279319er6cdb5735e6deb5f8 AT mail DOT gmail DOT com>
In-Reply-To: <6910a60908210020i6279319er6cdb5735e6deb5f8@mail.gmail.com>
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.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

--------------090807080409010309040809
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

Reini Urban schrieb:
> I needed the attached patch for the new cygwin-1.7,
> where cygwin_conv_to_full_win32_path() is deprecated.
> 
> But I doubt that this patch is fully correct.
> winFullPathname is mainly used to get the driveletter to check for the disksize
> and will fail for subst'ed drives.
> 
> And I saw databases which were created at the cwd instead of the given path.
> 
> Maybe someone sees the obvious mistake.
> 
> The sqlite ticket id is
> http://www.sqlite.org/src/tktview/2fd50fa6656950e19826089cd1abf19c35c26409

Oops, no attachment. Here it is:
-- 
Reini Urban
http://phpwiki.org/  http://murbreak.at/

--------------090807080409010309040809
Content-Type: text/x-patch;
 name="sqlite-3.6.17-cyg17.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="sqlite-3.6.17-cyg17.patch"

2009-08-21 Reini Urban <rurban AT x-ray DOT at>

        * os_win32.c (winFullPathname): support cygwin-1.7, fails with subst'ed drives

diff -u sqlite-3.6.17/src/os_win.c.orig sqlite-3.6.17/src/os_win.c
--- sqlite-3.6.17/src/os_win.c.orig	2009-08-08 19:44:58.000000000 +0200
+++ sqlite-3.6.17/src/os_win.c	2009-08-21 09:07:33.906250000 +0200
@@ -48,6 +48,7 @@
 
 #ifdef __CYGWIN__
 # include <sys/cygwin.h>
+# include <cygwin/version.h>
 #endif
 
 /*
@@ -1525,9 +1526,34 @@
   
 #if defined(__CYGWIN__)
   UNUSED_PARAMETER(nFull);
+#if (CYGWIN_VERSION_API_MINOR >= 181)
+  int nByte;
+  char *zOut;
+  WCHAR *zConverted;
+  nByte = nFull + 260 + 1001; /* from the cygwin sources */
+  zConverted = malloc( nByte*sizeof(zConverted[0]) );
+  if( zConverted==0 ){
+    return SQLITE_NOMEM;
+  }
+  cygwin_conv_path(CCP_POSIX_TO_WIN_W, zRelative, zConverted, nByte*sizeof(zConverted[0]));
+#if 0
+  printf("%s => %ls => %ls\n", zRelative, zConverted, &zConverted[4]);
+#endif
+  /* 4th: "\\?\D:..." => "D:..." */
+  zOut = unicodeToUtf8(&zConverted[4]);
+  free(zConverted);
+  if( zOut ){
+    sqlite3_snprintf(pVfs->mxPathname, zFull, "%s", zOut);
+    free(zOut);
+    return SQLITE_OK;
+  }else{
+    return SQLITE_NOMEM;
+  }
+#else
   cygwin_conv_to_full_win32_path(zRelative, zFull);
   return SQLITE_OK;
 #endif
+#endif
 
 #if SQLITE_OS_WINCE
   UNUSED_PARAMETER(nFull);


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

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

- Raw text -


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