public inbox for cygwin-patches@cygwin.com
 help / color / mirror / Atom feed
* patch to cron
@ 2015-11-20 21:24 Andy Stevens
  2015-11-21  9:59 ` Corinna Vinschen
  0 siblings, 1 reply; 2+ messages in thread
From: Andy Stevens @ 2015-11-20 21:24 UTC (permalink / raw)
  To: cygwin-patches

Hello Cygwin patchers, this is my first submission, hope I do OK.

I have discovered a bug in Vixie's cron in the bash script
/usr/bin/cron-config. The bug only appears on Windows 10 which has
an NT version of "10.0". This breaks the version checking in the
bash script. (Bash only supports integer compare or ASCII compare,
but not float compare.)

Below is my proposed patch.  Thanks to
http://stackoverflow.com/questions/8654051 for this bash magic.


--- /usr/bin/cron-config        2015-01-21 23:34:21.000000000 -0500
+++ cron-config 2015-11-20 16:08:24.574218000 -0500
@@ -126,7 +126,10 @@
      nt2003=""
      nt=$(uname -s | sed -ne 's/^CYGWIN_NT-\([^ ]*\)/\1/p')
      [ -z "$nt" ] && echo "Unknown system name" && return 1
-    [ "$nt" \> 5.1 ] && nt2003=yes
+    minver=5.1
+    if [ ${nt%.*} -eq ${minver%.*} ] && [ ${nt#*.} \> ${minver#*.} ] || [ ${nt%.*} -gt ${minver%.*} ]; then
+       nt2003=yes
+    fi
      return 0
  } # === End of get_NT() === #



Best,

--Andy Stevens
Electrical Science, Inc.
114 Pearl St., Suite 2B
Port Chester, NY 10573 USA
Office: +1-914-939-7396
Mobile: +1-646-552-0732
Email: stevens@electricalscience.com
Web: www.electricalscience.com


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-11-21  9:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-20 21:24 patch to cron Andy Stevens
2015-11-21  9:59 ` Corinna Vinschen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).