On 04/27/2010 06:49 AM, Rob Landley wrote:
On Wednesday 21 April 2010 16:22:47 Tomas Heinrich wrote:
        }
+#if ENABLE_UNICODE_SUPPORT
+       c = validate_wc(c);
+#endif
+#if ENABLE_UNICODE_COMBINING_WCHARS || ENABLE_UNICODE_WIDE_WCHARS
+       cmdedit_x += wcwidth(c);
+#else
+       cmdedit_x++;
+#endif
 #if ENABLE_FEATURE_NONPRINTABLE_INVERSE_PUT

No need for #ifdefs

  if (ENABLE_UNICODE_SUPPORT) c = validate_wc(c);
  if (ENABLE_UNICODE_COMBINING_WCHARS || ENABLE_UNICODE_WIDE_WCHARS)
    cmedit_x += wcwidth(c);
  else cmdedit_x++;

if (0) drops out due to the compiler's dead code elimination. And C99 requires that (0 || 0) gets simplified at compile time to (0)...

You're right. Thanks.

Tomas

_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to