From: Andy Stevens <stevens@electricalscience.com>
To: cygwin-patches@cygwin.com
Subject: patch to cron
Date: Fri, 20 Nov 2015 21:24:00 -0000 [thread overview]
Message-ID: <564F8F88.30905@electricalscience.com> (raw)
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
next reply other threads:[~2015-11-20 21:24 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-20 21:24 Andy Stevens [this message]
2015-11-21 9:59 ` Corinna Vinschen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=564F8F88.30905@electricalscience.com \
--to=stevens@electricalscience.com \
--cc=cygwin-patches@cygwin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).