Subject: | cygwin-1.7 breakage cygwin_conv_path and utf8 support |
Attached fixes the most important parts of the cygwin-1.7 breakage.
Reason: cygwin_conv_to_full_win32_path is deprecated and replaced by
cygwin_conv_path(CCP_POSIX_TO_WIN_A, ...)
There are still test problems with non-latin paths though,
but at least I can work with latin paths.
I believe the tests are bogus.
t/33_non_latin_path.t (Wstat: 7168 Tests: 23 Failed: 3)
Failed tests: 8, 17, 23
Non-zero exit status: 28
Parse errors: Bad plan. You planned 25 tests but ran 23.
t/rt_29629_sqlite_where_length.t (Wstat: 0 Tests: 17 Failed: 0)
TODO passed: 5, 11
--
Reini Urban
Subject: | DBD-SQLite-1.25.patch |
difforig DBD-SQLite-1.25
diff -u DBD-SQLite-1.25/sqlite3.c.orig
--- DBD-SQLite-1.25/sqlite3.c.orig 2009-04-23 12:12:04.000000000 +0200
+++ DBD-SQLite-1.25/sqlite3.c 2009-08-20 13:10:19.812500000 +0200
@@ -25938,6 +25938,7 @@
#ifdef __CYGWIN__
# include <sys/cygwin.h>
+# include <cygwin/version.h>
#endif
/*
@@ -27630,9 +27631,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);