Update of /cvsroot/ufraw/ufraw
In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv31174

Modified Files:
        ufraw_conf.c 
Log Message:
Read numbers on the command line i C locale. Fix for bug #2917703.

Index: ufraw_conf.c
===================================================================
RCS file: /cvsroot/ufraw/ufraw/ufraw_conf.c,v
retrieving revision 1.162
retrieving revision 1.163
diff -u -d -r1.162 -r1.163
--- ufraw_conf.c        24 Feb 2010 00:24:15 -0000      1.162
+++ ufraw_conf.c        27 Feb 2010 10:35:44 -0000      1.163
@@ -1702,7 +1702,7 @@
     cmd->ufobject = ufraw_command_line_new();
     UFObject *cmdImage = ufgroup_element(cmd->ufobject, ufRawImage);
     int index=0, c, i;
-    char *base;
+    char *base, *locale;
     char *baseCurveName=NULL, *baseCurveFile=NULL,
         *curveName=NULL, *curveFile=NULL, *outTypeName=NULL, *rotateName=NULL,
         *createIDName=NULL, *outPath=NULL, *output=NULL, *conf=NULL,
@@ -1814,12 +1814,15 @@
        case 'w': // --wb
        case 't': // --temperature
        case 'g': // -- green
+           locale = uf_set_locale_C();
            if (!ufobject_set_string(optPointer[index], optarg)) {
                ufraw_message(UFRAW_ERROR,
                        _("'%s' is not a valid value for the --%s option."),
                        optarg, options[index].name);
+               uf_reset_locale(locale);
                return -1;
            }
+           uf_reset_locale(locale);
            if (!ufgroup_add(cmdImage, optPointer[index]))
                return -1;
            break;
@@ -1839,12 +1842,15 @@
        case 'H':
        case 'y':
        case 'n':
+           locale = uf_set_locale_C();
            if (sscanf(optarg, "%lf", (double *)optPointer[index])==0) {
                ufraw_message(UFRAW_ERROR,
                        _("'%s' is not a valid value for the --%s option."),
                        optarg, options[index].name);
+               uf_reset_locale(locale);
                return -1;
            }
+           uf_reset_locale(locale);
            break;
        case 'x':
        case 'X':
@@ -1854,12 +1860,15 @@
        case '2':
        case '3':
        case '4':
+           locale = uf_set_locale_C();
            if (sscanf(optarg, "%d", (int *)optPointer[index])==0) {
                ufraw_message(UFRAW_ERROR,
                        _("'%s' is not a valid value for the --%s option."),
                        optarg, options[index].name);
+               uf_reset_locale(locale);
                return -1;
            }
+           uf_reset_locale(locale);
            break;
        case 'B':
        case 'S':


------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
ufraw-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ufraw-cvs

Reply via email to