ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/BDB/BDB.xs
(Generate patch)

Comparing BDB/BDB.xs (file contents):
Revision 1.35 by root, Sun Mar 30 07:12:12 2008 UTC vs.
Revision 1.36 by root, Sun Mar 30 08:01:58 2008 UTC

64#endif 64#endif
65 65
66static char * 66static char *
67get_bdb_filename (SV *sv) 67get_bdb_filename (SV *sv)
68{ 68{
69 return !SvOK (sv) 69 if (!SvOK (sv))
70 ? 0 70 return 0;
71 : 71
72#if _WIN32 72#if _WIN32
73 SvPVutf8_nolen (sv) 73 /* win32 madness + win32 perl absolutely brokenness make for horrible hacks */
74 {
75 STRLEN len;
76 char *src = SvPVbyte (sv, len);
77 SV *t1 = sv_newmortal ();
78 SV *t2 = sv_newmortal ();
79
80 sv_upgrade (t1, SVt_PV); SvPOK_only (t1); SvGROW (t1, len * 16 + 1);
81 sv_upgrade (t2, SVt_PV); SvPOK_only (t2); SvGROW (t2, len * 16 + 1);
82
83 len = MultiByteToWideChar (CP_ACP, 0, src, len, (WCHAR *)SvPVX (t1), SvLEN (t1) / sizeof (WCHAR));
84 len = WideCharToMultiByte (CP_UTF8, 0, (WCHAR *)SvPVX (t1), len, SvPVX (t2), SvLEN (t2), 0, 0);
85 SvPOK_only (t2);
86 SvPVX (t2)[len] = 0;
87 SvCUR_set (t2, len);
88
89 return SvPVX (t2);
90 }
74#else 91#else
75 SvPVbyte_nolen (sv) 92 return SvPVbyte_nolen (sv);
76#endif 93#endif
77 ;
78} 94}
79 95
80static void 96static void
81debug_errcall (const DB_ENV *dbenv, const char *errpfx, const char *msg) 97debug_errcall (const DB_ENV *dbenv, const char *errpfx, const char *msg)
82{ 98{

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines