Re: cfdisk, wrong interpretation of yes in non-english language

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Am 26.08.2014 13:33, schrieb tnut@xxxxxxxxx:
> Le 2014-08-26 12:41, Stephan Müller a écrit :
>> Am 26.08.2014 11:18, schrieb tnut@xxxxxxxxx:
>>> I'm building a new installer for the NuTyX distribution.
>>>
>>> If another language then english is choose as native language, some answer are wrong interpreted
>>>
>>> I think you should check both cases are wrong instead of one of them or do the test in the opposite way
>>>
>>> Here is a proposal of patch:
>>>
>>>
>>> --- util-linux-2.25/disk-utils/cfdisk.c 2014-07-21 13:36:21.000000000 +0000
>>> +++ util-linux-2.25-new/disk-utils/cfdisk.c     2014-08-25 18:52:17.000000000 +0000
>>> @@ -1834,8 +1834,8 @@
>>>                           buf, sizeof(buf));
>>>
>>>                 ref = 1;
>>> -               if (rc <= 0 || strcasecmp(buf, "yes") != 0
>>> -                           || strcasecmp(buf, _("yes")) != 0) {
>>> +               if (rc <= 0 ||  (strcasecmp(buf, "yes") != 0
>>> +                           && strcasecmp(buf, _("yes")) != 0)) {
>>>                         info = _("Did not write partition table to disk");
>>>                         break;
>>>                 }
>>>
>>
>> Why are both tests necessary at all? If NLS is disabled, both tests
>> agree. If it is enabled, we should test against the gettext translated
>> version only (2nd strcasecmp).
>>
> 
> I did this test before, unfortunatly if the translation is wrong done asking yes or no it's not working without double check
> 

Ah, ok. So we have English as backup. You could always type "yes" to write your partition table - no matter of your locale. Still I don't get why this ever worked with NLS enabled - did it? Say a for French, _("yes") expands to "oui". So

  strcasecmp(buf, "yes") != 0 || strcasecmp(buf, ("oui")) != 0

is always true. So not some, but all affirmative answers are mistreated. Your patch will fix that.

 ~stephan

--
To unsubscribe from this list: send the line "unsubscribe util-linux" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux