000-compile.patch 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. --- a/misc-utils/cal.c
  2. +++ b/misc-utils/cal.c
  3. @@ -291,41 +291,6 @@ main(int argc, char **argv) {
  4. }
  5. #endif
  6. -/*
  7. - * The traditional Unix cal utility starts the week at Sunday,
  8. - * while ISO 8601 starts at Monday. We read the start day from
  9. - * the locale database, which can be overridden with the
  10. - * -s (Sunday) or -m (Monday) options.
  11. - */
  12. -#if HAVE_DECL__NL_TIME_WEEK_1STDAY
  13. - /*
  14. - * You need to use 2 locale variables to get the first day of the week.
  15. - * This is needed to support first_weekday=2 and first_workday=1 for
  16. - * the rare case where working days span across 2 weeks.
  17. - * This shell script shows the combinations and calculations involved:
  18. - *
  19. - * for LANG in en_US ru_RU fr_FR csb_PL POSIX; do
  20. - * printf "%s:\t%s + %s -1 = " $LANG $(locale week-1stday first_weekday)
  21. - * date -d"$(locale week-1stday) +$(($(locale first_weekday)-1))day" +%w
  22. - * done
  23. - *
  24. - * en_US: 19971130 + 1 -1 = 0 #0 = sunday
  25. - * ru_RU: 19971130 + 2 -1 = 1
  26. - * fr_FR: 19971201 + 1 -1 = 1
  27. - * csb_PL: 19971201 + 2 -1 = 2
  28. - * POSIX: 19971201 + 7 -1 = 0
  29. - */
  30. - {
  31. - int wfd;
  32. - union { unsigned int word; char *string; } val;
  33. - val.string = nl_langinfo(_NL_TIME_WEEK_1STDAY);
  34. -
  35. - wfd = val.word;
  36. - wfd = day_in_week(wfd % 100, (wfd / 100) % 100, wfd / (100 * 100));
  37. - weekstart = (wfd + *nl_langinfo(_NL_TIME_FIRST_WEEKDAY) - 1) % 7;
  38. - }
  39. -#endif
  40. -
  41. yflag = 0;
  42. while ((ch = getopt_long(argc, argv, "13mjsyVh", longopts, NULL)) != -1)
  43. switch(ch) {