*
* See original copyright at the end of this file
*
- * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
+ * Licensed under GPLv2 or later, see file LICENSE in this source tree.
*/
/* BB_AUDIT SUSv3 compliant with -j and -y extensions (from util-linux). */
/* "Su Mo Tu We Th Fr Sa" */
/* -j heading: */
/* " Su Mo Tu We Th Fr Sa" */
- char day_headings[ENABLE_FEATURE_ASSUME_UNICODE ? 28 * 6 : 28];
- IF_FEATURE_ASSUME_UNICODE(char *hp = day_headings;)
+ char day_headings[ENABLE_UNICODE_SUPPORT ? 28 * 6 : 28];
+ IF_UNICODE_SUPPORT(char *hp = day_headings;)
char buf[40];
init_unicode();
if (argv[2]) {
bb_show_usage();
}
- month = xatou_range(*argv++, 1, 12);
+ if (!(flags & 2)) { /* no -y */
+ month = xatou_range(*argv, 1, 12);
+ }
+ argv++;
}
year = xatou_range(*argv, 1, 9999);
}
zero_tm.tm_wday = i;
/* abbreviated weekday name according to locale */
strftime(buf, sizeof(buf), "%a", &zero_tm);
-#if ENABLE_FEATURE_ASSUME_UNICODE
+#if ENABLE_UNICODE_SUPPORT
if (julian)
*hp++ = ' ';
{
- char *two_wchars = unicode_cut_nchars(2, buf);
+ char *two_wchars = unicode_conv_to_printable_fixedwidth(NULL, buf, 2);
strcpy(hp, two_wchars);
free(two_wchars);
}
#endif
}
} while (++i < 12);
- IF_FEATURE_ASSUME_UNICODE(hp[-1] = '\0';)
+ IF_UNICODE_SUPPORT(hp[-1] = '\0';)
if (month) {
unsigned row, len, days[MAXDAYS];