[LDTP-Dev] [PATCH] fix for allowing under score characters in strings used in scripting

Premkumar Jothimani prem.jothimani at gmail.com
Fri Nov 25 01:36:19 PST 2005


Hi

I have attached patch for fixing the issue (explained in the mail snippet
below). Please review it.


> On 11/25/05, Premkumar Jothimani <prem.jothimani at gmail.com> wrote:
> >
> > Hi Mauricio
> >
> > Atlast I have found out the correct reason for the problem (still trying
> > to find a solution though). The problem is with the underscore ('_')
> > charcter in the file name that you give. In the localisation part the '_'
> > character is getting removed from the current string under processing. So
> > the given label and the one obtained at run time with after removing
> > underscore in it does not match. Please check it will work fine if the file
> > name given is changed to 'text2.txt' (without underscore).
> >
> > we will try to fix it as soon as possible. Till then please use strings
> > without '_' character.
> >
> > Thanks
> > Premkumar J
> >
> >
Regards
Premkumar J

? build
? fix-locale.patch
Index: localization.c
===================================================================
RCS file: /cvs/pyldtp/localization.c,v
retrieving revision 1.3
diff -u -p -r1.3 localization.c
--- localization.c    23 Nov 2005 11:36:46 -0000    1.3
+++ localization.c    25 Nov 2005 09:26:13 -0000
@@ -287,7 +287,7 @@ gchar *ldtp_compare_with_locale (gchar *
           collate = g_utf8_collate (locale_msg, str);
           g_free (str);
         }
-      else
+      if (collate)
         collate = g_utf8_collate (locale_msg, utf8_string);
       if (!collate)
         break;
@@ -304,7 +304,7 @@ gchar *ldtp_compare_with_locale (gchar *
           collate = g_utf8_collate (locale_msg, str);
           g_free (str);
         }
-      else
+      if (collate)
         collate = g_utf8_collate (locale_msg, utf8_string);
     }
       g_free (key);
@@ -320,8 +320,8 @@ gchar *ldtp_compare_with_locale (gchar *
       collate = g_utf8_collate (locale_msg, str);
       g_free (str);
     }
-      else
-      collate = g_utf8_collate (locale_msg, utf8_string);
+      if (collate)
+    collate = g_utf8_collate (locale_msg, utf8_string);
     }
   if (!collate)
     return utf8_string;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/ldtp-dev/attachments/20051125/197d638c/attachment.html


More information about the LDTP-dev mailing list