[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Gettext bug?
From: |
Bruno Haible |
Subject: |
Re: Gettext bug? |
Date: |
Fri, 14 Jul 2006 14:13:34 +0200 |
User-agent: |
KMail/1.9.1 |
Hi,
Steffen Macke wrote:
> I hope that you're the right person to address for possible gettext bugs.
The canonical address is bug-gnu-gettext at gnu dot org.
> I'm using the gettext 0.14.5 libraries provided by Tor:
>
> http://www.gimp.org/~tml/gimp/win32/downloads.html
>
> When trying to generate Java Resource bundles, I get the following
> error message:
>
> msgfmt --java2 -d ..\..\..\servlet\WEB-INF\classes -l ar_AR -r bmfo bmfo.po
> msgfmt: cannot create a temporary directory using template "\/msgK5G9pb":
> Invalid argument
Thanks for reporting this. This occurs because
- you haven't set a TMPDIR environment variable,
- mingw defines P_tmpdir to "\\",
- msgfmt tries to append a subdirectory name to this pathname in a
stupid way.
I'll use the appended patch. As a workaround, just set TMPDIR to "/temp"
or similar.
> Trying to compile gettext 0.14.5 with MinGW (gcc 3.4.2) failed for me:
>
> .libs/mbswidth.o(.text+0x8b): In function `mbsnwidth':
> c:/data/home/sdteffen/src/gettext-0.14.5/gettext-tools/lib/mbswidth.c:154:
> undefined reference to `mbrtowc'
gettext-0.14.x does not support building with mingw. It only supports it
with Cygwin and --disable-shared. But gettext-0.15 will support mingw.
Bruno
2006-07-13 Bruno Haible <address@hidden>
Fix construction of temporary directory names on mingw.
* tmpdir.c (ISSLASH): New macro.
(path_search): Use it, and remove also the first character if it is
a slash.
Reported by Steffen Macke <address@hidden>.
diff -r -c3 --exclude='*.po*' --exclude='*.info*' --exclude='*_*.html'
--exclude='*.*.html' --exclude='*.[13]' --exclude='*.1.in'
--exclude=Makefile.in --exclude=aclocal.m4 --exclude=configure
--exclude=version.texi --exclude=stamp-vti --exclude='po-*-gen*.[ch]'
--exclude='*.o' --exclude='*.lo' --exclude='*.gmo' --exclude=ABOUT-NLS
--exclude='javadoc[12]' --exclude=CVS gettext-cvs/gettext-tools/lib/tmpdir.c
gettext-6/gettext-tools/lib/tmpdir.c
*** gettext-cvs/gettext-tools/lib/tmpdir.c Fri Jun 30 00:27:34 2006
--- gettext-6/gettext-tools/lib/tmpdir.c Fri Jul 14 02:27:51 2006
***************
*** 73,78 ****
--- 73,89 ----
# define __secure_getenv getenv
#endif
+ /* Pathname support.
+ ISSLASH(C) tests whether C is a directory separator character.
+ */
+ #if defined _WIN32 || defined __WIN32__ || defined __CYGWIN__ || defined
__EMX__ || defined __DJGPP__
+ /* Win32, Cygwin, OS/2, DOS */
+ # define ISSLASH(C) ((C) == '/' || (C) == '\\')
+ #else
+ /* Unix */
+ # define ISSLASH(C) ((C) == '/')
+ #endif
+
/* Return nonzero if DIR is an existent directory. */
static bool
***************
*** 131,137 ****
}
dlen = strlen (dir);
! while (dlen > 1 && dir[dlen - 1] == '/')
dlen--; /* remove trailing slashes */
/* check we have room for "${dir}/${pfx}XXXXXX\0" */
--- 142,148 ----
}
dlen = strlen (dir);
! while (dlen >= 1 && ISSLASH (dir[dlen - 1]))
dlen--; /* remove trailing slashes */
/* check we have room for "${dir}/${pfx}XXXXXX\0" */
- Re: Gettext bug?,
Bruno Haible <=