Bug 412 - d_printf() cannot handle '\'
d_printf() cannot handle '\'
Status: CLOSED FIXED
Product: Samba 3.0
Classification: Unclassified
Component: Extended Characters
3.0.0preX
All All
: P3 normal
: none
Assigned To: Alexander Bokovoy
:
Depends on:
Blocks: 413
  Show dependency treegraph
 
Reported: 2003-09-07 07:59 UTC by TAKAHASHI Motonobu
Modified: 2005-08-24 10:21 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description TAKAHASHI Motonobu 2003-09-07 07:59:54 UTC
d_printf() cannot handle messege strings including '\', for example
"this is a test.\n".
To fix this problem or to modify messege strings not to include '\' is required
to support SWAT i18n function.
Comment 1 TAKEDA yasuma 2003-09-21 06:56:57 UTC
Example. 
ja.msg 
msgid "original message\n"
msgstr "Japanes message\n"

lang_ja.tdb includes '\' and 'n' in msgid and msgstr.
But d_printf(_("xxx\n")) search "xxx" and '0x0A' instead of '\' and 'n'.
Therefore it can't find correct message.


--- lang_tdb.c.org      2003-09-18 13:05:21.000000000 +0900
+++ lang_tdb.c  2003-09-18 13:06:30.000000000 +0900
@@ -58,6 +58,8 @@
                        if (*msgstr == 0) {
                                msgstr = msgid;
                        }
+                       all_string_sub(msgid, "\\n", "\n", 0);
+                       all_string_sub(msgstr, "\\n", "\n", 0);
                        key.dptr = msgid;
                        key.dsize = strlen(msgid)+1;
                        data.dptr = msgstr;
Comment 2 Tim Potter 2003-09-22 00:26:09 UTC
Applied.  Thanks Monyo!
Comment 3 Gerald (Jerry) Carter 2005-02-07 09:05:58 UTC
originally reported against one of the 3.0.0rc[1-4] releases.
Cleaning up non-production versions.
Comment 4 Gerald (Jerry) Carter 2005-08-24 10:21:37 UTC
sorry for the same, cleaning up the database to prevent unecessary reopens of bugs.