Changes of Revision 15
[-] | Changed | bacula.spec |
x 1
2 Group: Productivity/Archiving/Backup 3 AutoReqProv: on 4 Version: 2.4.4 5 -Release: 1 6 +Release: 2 7 Summary: Bacula--The Network Backup Solution: Client Part 8 Url: http://www.bacula.org 9 Source0: %{name}-%{version}.tar.bz2 10
11 Patch: %{name}-%{version}-cflags.diff 12 Patch1: %{name}-%{version}-python.diff 13 Patch2: %{name}-%{version}-fortify.diff 14 +Patch3: %{version}-bat-install.patch 15 +Patch4: %{version}-fortify.patch 16 +Patch5: %{version}-jobname-edit.patch 17 +Patch6: %{version}-label-failure.patch 18 +Patch7: %{version}-reload.patch 19 +Patch8: %{version}-sd-deadlock.patch 20 +Patch9: %{version}-time_t_64bit.patch 21 +Patch10: %{version}-tray-sizing.patch 22 +Patch11: %{version}-winvss.patch 23 BuildRoot: %{_tmppath}/%{name}-%{version}-build 24 25 %description 26
27 %patch 28 %patch1 29 %patch2 30 +%patch3 31 +%patch4 32 +%patch5 33 +%patch6 34 +%patch7 35 +%patch8 36 +%patch9 37 +%patch10 38 +%patch11 39 40 %build 41 CFLAGS="-fno-strict-aliasing $RPM_OPT_FLAGS $(ncurses5-config --cflags)" LDFLAGS="-L/usr/%{_lib}/mysql $(ncurses5-config --libs)" ./configure \ 42
43 %dir /var/lib/bacula/working 44 45 %changelog 46 +* Thu May 07 2009 Carsten Schoene <cs@linux-administrator.com> - 2.4.4-2 47 +- added 2.4.4 patches 48 + 49 +* Wed Feb 18 2009 Carsten Schoene <cs@linux-administrator.com> - 2.4.4-1 50 +- build version 2.4.4 51 + 52 * Wed Sep 10 2008 anicka@suse.cz 53 - update to 2.4.2 54 * When a migration job actually runs, re-check the Job record 55 |
||
[+] | Added | 2.4.4-bat-install.patch ^ |
@@ -0,0 +1,29 @@ + + This patch fixes bat.pro.in so that bat will install correctly. + + Apply it to version 2.4.4 with: + + cd <bacula-source> + patch -p0 <2.4.4-bat-install.patch + ./configure <your options> + make + ... + make install + + +Index: src/qt-console/bat.pro.in +=================================================================== +--- src/qt-console/bat.pro.in (revision 8326) ++++ src/qt-console/bat.pro.in (working copy) +@@ -9,9 +9,9 @@ + # + CONFIG += qt debug @QWT@ + +-bins.path = /$(DESTDIR)@sbindir@ ++bins.path = $(DESTDIR)@sbindir@ + bins.files = ./bat +-confs.path = /$(DESTDIR)@sysconfdir@ ++confs.path = $(DESTDIR)@sysconfdir@ + confs.commands = ./install_conf_file + + TEMPLATE = app | ||
[+] | Added | 2.4.4-fortify.patch ^ |
@@ -0,0 +1,33 @@ + + This patch permit to disable the _FORTIFY_SOURCE flag that is + added by some distributions. + + Apply it to version 2.4.4 with: + + cd <bacula-source> + patch -p0 <2.4.4-fortify.patch + ./configure <your options> + make + ... + make install + + + +Index: src/bacula.h +=================================================================== +--- src/bacula.h (révision 8436) ++++ src/bacula.h (copie de travail) +@@ -34,6 +34,13 @@ + #ifndef _BACULA_H + #define _BACULA_H 1 + ++/* Disable FORTIFY_SOURCE, because bacula uses is own memory ++ * manager ++ */ ++#ifdef _FORTIFY_SOURCE ++#undef _FORTIFY_SOURCE ++#endif ++ + #ifdef __cplusplus + /* Workaround for SGI IRIX 6.5 */ + #define _LANGUAGE_C_PLUS_PLUS 1 | ||
[+] | Added | 2.4.4-jobname-edit.patch ^ |
@@ -0,0 +1,26 @@ + + This patch fixes bug #1255 'variable %n changed' + + Apply it to version 2.4.4 with: + + cd <bacula-source> + patch -p0 <2.4.4-jobname-edit.patch + ./configure <your options> + make + ... + make install + + +Index: src/dird/job.c +=================================================================== +--- src/dird/job.c (revision 8455) ++++ src/dird/job.c (working copy) +@@ -787,7 +787,7 @@ + len = strlen(dt) + 5; /* dt + .%02d EOS */ + bstrncpy(name, base_name, sizeof(name)); + name[sizeof(name)-len] = 0; /* truncate if too long */ +- bsnprintf(jcr->Job, sizeof(jcr->Job), "%s.%s.%02d", name, dt, seq); /* add date & time */ ++ bsnprintf(jcr->Job, sizeof(jcr->Job), "%s.%s_%02d", name, dt, seq); /* add date & time */ + /* Convert spaces into underscores */ + for (p=jcr->Job; *p; p++) { + if (*p == ' ') { | ||
[+] | Added | 2.4.4-label-failure.patch ^ |
@@ -0,0 +1,85 @@ + [label-failure.patch] IQ + This patch should fix the problems labeling a tape while + Bacula is requesting you to mount or label a new tape. + It should also fix problems where Bacula will not recognize + that a new tape is inserted or created and it keeps asking for + a different tape. It fixes bug #1227. + + Apply it to 2.4.4 (possibly earlier versions) with: + + cd <bacula-source> + patch -p0 <2.4.4-label-failure.patch + ./configure <your-options> + make + ... + make install + ... + + + +Index: src/stored/wait.c +=================================================================== +--- src/stored/wait.c (revision 8605) ++++ src/stored/wait.c (working copy) +@@ -1,7 +1,7 @@ + /* + Bacula® - The Network Backup Solution + +- Copyright (C) 2000-2008 Free Software Foundation Europe e.V. ++ Copyright (C) 2000-2009 Free Software Foundation Europe e.V. + + The main author of Bacula is Kern Sibbald, with contributions from + many others, a complete list can be found in the file AUTHORS. +@@ -20,7 +20,7 @@ + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301, USA. + +- Bacula® is a registered trademark of John Walker. ++ Bacula® is a registered trademark of Kern Sibbald. + The licensor of Bacula is the Free Software Foundation Europe + (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich, + Switzerland, email:ftf@fsfeurope.org. +@@ -62,8 +62,14 @@ + + dev->dlock(); + Dmsg1(dbglvl, "Enter blocked=%s\n", dev->print_blocked()); ++ ++ /* ++ * Since we want to mount a tape, make sure current one is ++ * not marked as using this drive. ++ */ ++ volume_unused(dcr); ++ + unmounted = is_device_unmounted(dev); +- + dev->poll = false; + /* + * Wait requested time (dev->rem_wait_sec). However, we also wake up every +Index: src/stored/reserve.c +=================================================================== +--- src/stored/reserve.c (revision 8605) ++++ src/stored/reserve.c (working copy) +@@ -20,7 +20,7 @@ + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301, USA. + +- Bacula® is a registered trademark of John Walker. ++ Bacula® is a registered trademark of Kern Sibbald. + The licensor of Bacula is the Free Software Foundation Europe + (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich, + Switzerland, email:ftf@fsfeurope.org. +@@ -346,8 +346,12 @@ + goto get_out; + } + Dmsg3(dbglvl, "jid=%u reserve_vol free vol=%s at %p\n", jid(), vol->vol_name, vol->vol_name); +- free_volume(dev); +- dev->set_unload(); /* have to unload current volume */ ++ /* If old Volume is still mounted, must unload it */ ++ if (strcmp(vol->vol_name, dev->VolHdr.VolumeName) == 0) { ++ Dmsg0(50, "set_unload\n"); ++ dev->set_unload(); /* have to unload current volume */ ++ } ++ free_volume(dev); /* Release old volume entry */ + debug_list_volumes("reserve_vol free"); + } + } | ||
[+] | Added | 2.4.4-reload.patch ^ |
@@ -0,0 +1,165 @@ + + This patch fixes bug #1211 crash during reload with bad dird.conf file. + + Apply it to version 2.4.4 with: + + cd <bacula-source> + patch -p0 <2.4.4-reload.patch + ./configure <your options> + make + ... + make install + + +Index: src/lib/parse_conf.c +=================================================================== +--- src/lib/parse_conf.c (revision 8393) ++++ src/lib/parse_conf.c (working copy) +@@ -284,6 +284,7 @@ + } + if (token != T_EQUALS) { + scan_err1(lc, _("expected an =, got: %s"), lc->str); ++ return; + } + break; + } +@@ -304,6 +305,7 @@ + Dmsg1(900, "store_msgs dest=%s:\n", NPRT(dest)); + if (token != T_EQUALS) { + scan_err1(lc, _("expected an =, got: %s"), lc->str); ++ return; + } + scan_types(lc, (MSGS *)(item->value), item->code, dest, NULL); + free_pool_memory(dest); +@@ -312,7 +314,7 @@ + + default: + scan_err1(lc, _("Unknown item code: %d\n"), item->code); +- break; ++ return; + } + } + scan_to_eol(lc); +@@ -352,7 +354,7 @@ + } + if (!found) { + scan_err1(lc, _("message type: %s not found"), str); +- /* NOT REACHED */ ++ return; + } + + if (msg_type == M_MAX+1) { /* all? */ +@@ -384,12 +386,14 @@ + lex_get_token(lc, T_NAME); + if (!is_name_valid(lc->str, &msg)) { + scan_err1(lc, "%s\n", msg); ++ return; + } + free_pool_memory(msg); + /* Store the name both pass 1 and pass 2 */ + if (*(item->value)) { + scan_err2(lc, _("Attempt to redefine name \"%s\" to \"%s\"."), + *(item->value), lc->str); ++ return; + } + *(item->value) = bstrdup(lc->str); + scan_to_eol(lc); +@@ -481,10 +485,12 @@ + if (res == NULL) { + scan_err3(lc, _("Could not find config Resource %s referenced on line %d : %s\n"), + lc->str, lc->line_no, lc->line); ++ return; + } + if (*(item->value)) { + scan_err3(lc, _("Attempt to redefine resource \"%s\" referenced on line %d : %s\n"), + item->name, lc->line_no, lc->line); ++ return; + } + *(item->value) = (char *)res; + } +@@ -520,6 +526,7 @@ + if (i >= count) { + scan_err4(lc, _("Too many %s directives. Max. is %d. line %d: %s\n"), + lc->str, count, lc->line_no, lc->line); ++ return; + } + list = New(alist(10, not_owned_by_alist)); + } +@@ -530,6 +537,7 @@ + if (res == NULL) { + scan_err3(lc, _("Could not find config Resource \"%s\" referenced on line %d : %s\n"), + item->name, lc->line_no, lc->line); ++ return; + } + Dmsg5(900, "Append %p to alist %p size=%d i=%d %s\n", + res, list, list->size(), i, item->name); +@@ -592,6 +600,7 @@ + if (res == NULL) { + scan_err3(lc, _("Missing config Resource \"%s\" referenced on line %d : %s\n"), + lc->str, lc->line_no, lc->line); ++ return; + } + } + scan_to_eol(lc); +@@ -655,12 +664,13 @@ + } + if (!size_to_uint64(bsize, strlen(bsize), &uvalue)) { + scan_err1(lc, _("expected a size number, got: %s"), lc->str); ++ return; + } + *(uint64_t *)(item->value) = uvalue; + break; + default: + scan_err1(lc, _("expected a size, got: %s"), lc->str); +- break; ++ return; + } + if (token != T_EOL) { + scan_to_eol(lc); +@@ -697,12 +707,13 @@ + } + if (!duration_to_utime(period, &utime)) { + scan_err1(lc, _("expected a time period, got: %s"), period); ++ return; + } + *(utime_t *)(item->value) = utime; + break; + default: + scan_err1(lc, _("expected a time period, got: %s"), lc->str); +- break; ++ return; + } + if (token != T_EOL) { + scan_to_eol(lc); +@@ -721,6 +732,7 @@ + *(uint32_t *)(item->value) &= ~(item->code); + } else { + scan_err2(lc, _("Expect %s, got: %s"), "YES, NO, TRUE, or FALSE", lc->str); /* YES and NO must not be translated */ ++ return; + } + scan_to_eol(lc); + set_bit(index, res_all.hdr.item_present); +@@ -736,6 +748,7 @@ + *(bool *)(item->value) = false; + } else { + scan_err2(lc, _("Expect %s, got: %s"), "YES, NO, TRUE, or FALSE", lc->str); /* YES and NO must not be translated */ ++ return; + } + scan_to_eol(lc); + set_bit(index, res_all.hdr.item_present); +@@ -761,6 +774,7 @@ + } + if (i != 0) { + scan_err1(lc, _("Expected a Tape Label keyword, got: %s"), lc->str); ++ return; + } + scan_to_eol(lc); + set_bit(index, res_all.hdr.item_present); +@@ -910,6 +924,7 @@ + Dmsg0(900, "T_EOB => define new resource\n"); + if (res_all.hdr.name == NULL) { + scan_err0(lc, _("Name not specified for resource")); ++ return 0; + } + save_resource(res_type, items, pass); /* save resource */ + break; | ||
[+] | Added | 2.4.4-sd-deadlock.patch ^ |
@@ -0,0 +1,67 @@ + + This patch is backported from the development SVN and should fix + bug #1213, which is a deadlock in the SD when a volume is on the + wrong drive. + + Apply it to version 2.4.4 with: + + cd <bacula-source> + patch -p0 <2.4.4-sd-deadlock.patch + ./configure <your options> + make + ... + make install + + +Index: src/stored/reserve.c +=================================================================== +--- src/stored/reserve.c (revision 8426) ++++ src/stored/reserve.c (working copy) +@@ -1,7 +1,7 @@ + /* + Bacula® - The Network Backup Solution + +- Copyright (C) 2000-2008 Free Software Foundation Europe e.V. ++ Copyright (C) 2000-2009 Free Software Foundation Europe e.V. + + The main author of Bacula is Kern Sibbald, with contributions from + many others, a complete list can be found in the file AUTHORS. +@@ -498,7 +498,6 @@ + void DCR::unreserve_device() + { + lock_volumes(); +- dev->dlock(); + if (is_reserved()) { + clear_reserved(); + reserved_volume = false; +@@ -514,7 +513,6 @@ + volume_unused(this); + } + } +- dev->dunlock(); + unlock_volumes(); + } + +Index: src/stored/acquire.c +=================================================================== +--- src/stored/acquire.c (revision 8426) ++++ src/stored/acquire.c (working copy) +@@ -1,7 +1,7 @@ + /* + Bacula® - The Network Backup Solution + +- Copyright (C) 2002-2008 Free Software Foundation Europe e.V. ++ Copyright (C) 2002-2009 Free Software Foundation Europe e.V. + + The main author of Bacula is Kern Sibbald, with contributions from + many others, a complete list can be found in the file AUTHORS. +@@ -647,8 +647,8 @@ + + /* Detach this dcr only if attached */ + if (dcr->attached_to_dev && dev) { ++ dev->dlock(); + dcr->unreserve_device(); +- dev->dlock(); + dcr->dev->attached_dcrs->remove(dcr); /* detach dcr from device */ + dcr->attached_to_dev = false; + // remove_dcr_from_dcrs(dcr); /* remove dcr from jcr list */ | ||
[+] | Added | 2.4.4-time_t_64bit.patch ^ |
@@ -0,0 +1,55 @@ + + This patch fixes bug #1247 - 64-bit time_t and varargs don't get along in some + printf-like formatting + + Apply it to version 2.4.4 with: + + cd <bacula-source> + patch -p0 <2.4.4-time_t_64bit.patch + ./configure <your options> + make + ... + make install + + +Index: src/stored/spool.c +=================================================================== +--- src/stored/spool.c (revision 8455) ++++ src/stored/spool.c (working copy) +@@ -306,7 +306,7 @@ + set_new_file_parameters(dcr); + + /* Subtracting run_time give us elapsed time - wait_time since we started despooling */ +- time_t despool_elapsed = time(NULL) - despool_start - jcr->run_time; ++ int32_t despool_elapsed = time(NULL) - despool_start - jcr->run_time; + + if (despool_elapsed <= 0) { + despool_elapsed = 1; +Index: src/stored/append.c +=================================================================== +--- src/stored/append.c (revision 8455) ++++ src/stored/append.c (working copy) +@@ -270,7 +270,7 @@ + do_fd_commands(jcr); /* finish dialog with FD */ + + +- time_t job_elapsed = time(NULL) - jcr->run_time; ++ int32_t job_elapsed = time(NULL) - jcr->run_time; + + if (job_elapsed <= 0) { + job_elapsed = 1; +Index: src/lib/message.c +=================================================================== +--- src/lib/message.c (revision 8455) ++++ src/lib/message.c (working copy) +@@ -780,8 +780,8 @@ + case MD_DIRECTOR: + Dmsg1(850, "DIRECTOR for following msg: %s", msg); + if (jcr && jcr->dir_bsock && !jcr->dir_bsock->errors) { +- bnet_fsend(jcr->dir_bsock, "Jmsg Job=%s type=%d level=%d %s", +- jcr->Job, type, mtime, msg); ++ bnet_fsend(jcr->dir_bsock, "Jmsg Job=%s type=%d level=%lld %s", ++ jcr->Job, type, (utime_t)mtime, msg); + } + break; + case MD_STDOUT: | ||
[+] | Added | 2.4.4-tray-sizing.patch ^ |
@@ -0,0 +1,59 @@ + + This patch fixes a text sizing problem in the tray-monitor. + It fixes bug #1219. + + Apply it to version 2.4.4 with: + + cd <bacula-source> + patch -p0 <2.4.4-tray-sizing.patch + ./configure <your options> + make + ... + make install + + +Index: src/tray-monitor/tray-monitor.c +=================================================================== +--- src/tray-monitor/tray-monitor.c (revision 8393) ++++ src/tray-monitor/tray-monitor.c (working copy) +@@ -1,7 +1,7 @@ + /* + Bacula® - The Network Backup Solution + +- Copyright (C) 2004-2007 Free Software Foundation Europe e.V. ++ Copyright (C) 2004-2009 Free Software Foundation Europe e.V. + + The main author of Bacula is Kern Sibbald, with contributions from + many others, a complete list can be found in the file AUTHORS. +@@ -97,6 +97,7 @@ + static GtkWidget *textview; + static GtkTextBuffer *buffer; + static GtkWidget *timeoutspinner; ++static GtkWidget *scrolledWindow; + char** xpm_generic_var; + static gboolean blinkstate = TRUE; + +@@ -409,9 +410,13 @@ + } + + gtk_box_pack_start(GTK_BOX(vbox), daemon_table, FALSE, FALSE, 0); +- ++ + textview = gtk_text_view_new(); + ++ scrolledWindow = gtk_scrolled_window_new(NULL, NULL); ++ gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scrolledWindow), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); ++ gtk_container_add(GTK_CONTAINER (scrolledWindow), textview); ++ + buffer = gtk_text_buffer_new(NULL); + + gtk_text_buffer_set_text(buffer, "", -1); +@@ -456,7 +461,7 @@ + + gtk_text_view_set_buffer(GTK_TEXT_VIEW(textview), buffer); + +- gtk_box_pack_start(GTK_BOX(vbox), textview, TRUE, TRUE, 0); ++ gtk_box_pack_start(GTK_BOX(vbox), scrolledWindow, TRUE, TRUE, 0); + + GtkWidget* hbox = gtk_hbox_new(FALSE, 10); + | ||
[+] | Added | 2.4.4-winvss.patch ^ |
@@ -0,0 +1,170 @@ + + This patch is fixes Fix bug #1246 Sometimes access with + VSS enabled. UCS conversion cache was not properly flushed + at the end of a Job. + + Apply it to version 2.4.4 with: + + cd <bacula-source> + patch -p0 <2.4.4-winvss.patch + ./configure <your options> + make + ... + make install + + +Index: src/filed/job.c +=================================================================== +--- src/filed/job.c (revision 8733) ++++ src/filed/job.c (working copy) +@@ -1,7 +1,7 @@ + /* + Bacula® - The Network Backup Solution + +- Copyright (C) 2000-2007 Free Software Foundation Europe e.V. ++ Copyright (C) 2000-2009 Free Software Foundation Europe e.V. + + The main author of Bacula is Kern Sibbald, with contributions from + many others, a complete list can be found in the file AUTHORS. +@@ -41,7 +41,7 @@ + #include "vss.h" + + static pthread_mutex_t vss_mutex = PTHREAD_MUTEX_INITIALIZER; +-static int enable_vss; ++static int enable_vss = 0; + #endif + + extern CLIENT *me; /* our client resource */ +@@ -1422,7 +1422,7 @@ + /* inform user about writer states */ + for (i=0; i < (int)g_pVSSClient->GetWriterCount(); i++) + if (g_pVSSClient->GetWriterState(i) < 1) { +- Jmsg(jcr, M_WARNING, 0, _("VSS Writer (PrepareForBackup): %s\n"), g_pVSSClient->GetWriterInfo(i)); ++ Jmsg(jcr, M_WARNING, 0, _("VSS Writer (PrepareForBackup): %s\n"), g_pVSSClient->GetWriterInfo(i)); + jcr->Errors++; + } + } +@@ -1506,6 +1506,7 @@ + Jmsg(jcr, msg_type, 0, _("VSS Writer (BackupComplete): %s\n"), g_pVSSClient->GetWriterInfo(i)); + } + } ++ Win32ConvCleanupCache(); + V(vss_mutex); + } + #endif +Index: src/win32/Makefile +=================================================================== +--- src/win32/Makefile (revision 8733) ++++ src/win32/Makefile (working copy) +@@ -30,7 +30,7 @@ + Makefile.inc: Makefile.inc.in + @echo Creating $@ + $(ECHO_CMD)TOPDIR=`(cd ../../..;pwd)`; \ +- if test -e ../../../cross-tools/mingw32/bin/mingw32-gcc; then \ ++ if test -e $${TOPDIR}/cross-tools/mingw32/bin/mingw32-gcc; then \ + BINDIR=$${TOPDIR}/cross-tools/mingw32/bin; \ + INCDIR=$${TOPDIR}/cross-tools/mingw32/mingw32/include; \ + DLLDIR=$${TOPDIR}/cross-tools/mingw32/mingw32/bin; \ +@@ -43,7 +43,7 @@ + echo "You must run build-win32-cross-tools and build-dependencies first.\n"; \ + exit 1; \ + fi ; \ +- $(ECHO_CMD)BUILDDIR=`(pwd)`; \ ++ BUILDDIR=`(pwd)`; \ + sed \ + -e "s^@BUILDDIR@^$${BUILDDIR}^" \ + -e "s^@TOPDIR@^$${TOPDIR}^" \ +Index: src/win32/compat/compat.cpp +=================================================================== +--- src/win32/compat/compat.cpp (revision 8733) ++++ src/win32/compat/compat.cpp (working copy) +@@ -1,7 +1,7 @@ + /* + Bacula® - The Network Backup Solution + +- Copyright (C) 2004-2008 Free Software Foundation Europe e.V. ++ Copyright (C) 2004-2009 Free Software Foundation Europe e.V. + + The main author of Bacula is Kern Sibbald, with contributions from + many others, a complete list can be found in the file AUTHORS. +@@ -51,8 +51,8 @@ + conversion is called 3 times (lstat, attribs, open), + by using the cache this is reduced to 1 time */ + +-static POOLMEM *g_pWin32ConvUTF8Cache = get_pool_memory(PM_FNAME); +-static POOLMEM *g_pWin32ConvUCS2Cache = get_pool_memory(PM_FNAME); ++static POOLMEM *g_pWin32ConvUTF8Cache = NULL; ++static POOLMEM *g_pWin32ConvUCS2Cache = NULL; + static DWORD g_dwWin32ConvUTF8strlen = 0; + static pthread_mutex_t Win32Convmutex = PTHREAD_MUTEX_INITIALIZER; + +@@ -69,8 +69,19 @@ + g_pVSSPathConvertW = pPathConvertW; + } + ++static void Win32ConvInitCache() ++{ ++ if (g_pWin32ConvUTF8Cache) { ++ return; ++ } ++ g_pWin32ConvUTF8Cache = get_pool_memory(PM_FNAME); ++ g_pWin32ConvUCS2Cache = get_pool_memory(PM_FNAME); ++} ++ ++ + void Win32ConvCleanupCache() + { ++ P(Win32Convmutex); + if (g_pWin32ConvUTF8Cache) { + free_pool_memory(g_pWin32ConvUTF8Cache); + g_pWin32ConvUTF8Cache = NULL; +@@ -82,6 +93,7 @@ + } + + g_dwWin32ConvUTF8strlen = 0; ++ V(Win32Convmutex); + } + + +@@ -451,11 +463,14 @@ + /* if we find the utf8 string in cache, we use the cached ucs2 version. + we compare the stringlength first (quick check) and then compare the content. + */ +- if (g_dwWin32ConvUTF8strlen == strlen(pszUTF)) { ++ if (!g_pWin32ConvUTF8Cache) { ++ Win32ConvInitCache(); ++ } else if (g_dwWin32ConvUTF8strlen == strlen(pszUTF)) { + if (bstrcmp(pszUTF, g_pWin32ConvUTF8Cache)) { ++ /* Return cached value */ + int32_t nBufSize = sizeof_pool_memory(g_pWin32ConvUCS2Cache); + *pszUCS = check_pool_memory_size(*pszUCS, nBufSize); +- wcscpy((LPWSTR) *pszUCS, (LPWSTR) g_pWin32ConvUCS2Cache); ++ wcscpy((LPWSTR) *pszUCS, (LPWSTR)g_pWin32ConvUCS2Cache); + V(Win32Convmutex); + return nBufSize / sizeof (WCHAR); + } +@@ -477,7 +492,7 @@ + wcscpy((LPWSTR) g_pWin32ConvUCS2Cache, (LPWSTR) *pszUCS); + + g_dwWin32ConvUTF8strlen = strlen(pszUTF); +- g_pWin32ConvUTF8Cache = check_pool_memory_size(g_pWin32ConvUTF8Cache, g_dwWin32ConvUTF8strlen+1); ++ g_pWin32ConvUTF8Cache = check_pool_memory_size(g_pWin32ConvUTF8Cache, g_dwWin32ConvUTF8strlen+2); + bstrncpy(g_pWin32ConvUTF8Cache, pszUTF, g_dwWin32ConvUTF8strlen+1); + V(Win32Convmutex); + +Index: src/win32/Makefile.inc.in +=================================================================== +--- src/win32/Makefile.inc.in (revision 8733) ++++ src/win32/Makefile.inc.in (working copy) +@@ -11,9 +11,9 @@ + + BUILDDIR := @BUILDDIR@ + TOPDIR := @TOPDIR@ +-DEPKGS := $(TOPDIR)/depkgs-mingw32 ++DEPKGS := @TOPDIR@/depkgs-mingw32 + +-DOCDIR := $(TOPDIR)/docs ++DOCDIR := @TOPDIR@/docs + BINDIR := ../release + LIBDIR := ../release + OBJDIR := . |