{"thread":{"id":"887","subject":"[COGITO PATCH] value too great for base (error token is \"-0800\")","startedAt":"2005-06-09T21:40:30Z","lastAt":"2005-06-10T22:19:36Z","messageCount":2,"participants":["Pavel Roskin","Petr Baudis"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"4805","messageId":"1118353230.2825.10.camel@dv","threadId":"887","inReplyTo":null,"subject":"[COGITO PATCH] value too great for base (error token is \"-0800\")","fromName":"Pavel Roskin","fromEmail":"proski@gnu.org","sentAt":"2005-06-09T21:40:30Z","receivedAt":"2005-06-09T21:40:30Z","isPatch":true,"sender":{"key":"proski@gnu.org","avatar":null},"body":"Hello!\n\nThe current cogito has problems with timezones that are too far from the\nGreenwich meridian :-)\n\nBash interprets numbers beginning with 0 as octals.  Therefore, we need\nto strip leading zeroes or zeroes following \"-\".  But if we get too\nzealous and strip all digits, we'll need to restore one 0.  I tried to\nwrite for sed portably, so I avoided some optimizations, such as\ns/^-\\?$/0/\n\nSigned-off-by: Pavel Roskin <proski@gnu.org>\n\ndiff --git a/cg-Xlib b/cg-Xlib\n--- a/cg-Xlib\n+++ b/cg-Xlib\n@@ -65,7 +65,7 @@ showdate () {\n \t[ \"$format\" ] || format=-R\n \tsec=${date[0]}; tz=${date[1]}\n \tif [ \"$has_gnudate\" ]; then\n-\t        dtz=${tz/+/}\n+\t        dtz=$(echo $tz | sed 's/^+//;s/^0*//;s/^-0*/-/;s/^$/0/;s/^-$/0/')\n \t\tlsec=$(($dtz / 100 * 3600 + $dtz % 100 * 60 + $sec))\n \t        pdate=\"$(date -ud \"1970-01-01 UTC + $lsec sec\" \"$format\" 2>/dev/null)\"\n \telse\n\n-- \nRegards,\nPavel Roskin\n\n"},{"id":"4834","messageId":"20050610221936.GA22111@pasky.ji.cz","threadId":"887","inReplyTo":"1118353230.2825.10.camel@dv","subject":"Re: [PATCH] Fix cogito handling of timezones","fromName":"Petr Baudis","fromEmail":"pasky@ucw.cz","sentAt":"2005-06-10T22:19:36Z","receivedAt":"2005-06-10T22:19:36Z","isPatch":true,"sender":{"key":"pasky@ucw.cz","avatar":"https://avatars.githubusercontent.com/u/18439?v=4"},"body":"  Hello,\n\n  FYI, from the contestants for the octal fix, I've chosen to take Dan's\nsolution - not that I'd think it's the best, but it's simple and\nmainly I'm taking other Dan's changes and I don't like solving\nconflicts.\n\n> +\tlocal secs=$1 tzhours=${2:0:3} tzmins=${2:0:1}${2:3} format=$3\n> +\t# bash doesn't like leading zeros\n> +\t[ \"${tzhours:1:1}\" = 0 ] && tzhours=${2:0:1}${2:2:1}\n> +\tsecs=$((secs + tzhours * 3600 + tzmins * 60))\n\n-- \n\t\t\t\tPetr \"Pasky\" Baudis\nStuff: http://pasky.or.cz/\n<Espy> be careful, some twit might quote you out of context..\n"}]}