Fixed timespec parsing to work with single numbers

This commit is contained in:
Robin Kupper
2011-07-27 01:35:47 +02:00
parent 428ac4bb2a
commit 0dbc496f0b

View File

@@ -75,6 +75,8 @@ public class Utils
public static int parseTimeSpec(String[] spec) {
if (spec == null || spec.length < 1 || spec.length > 2)
return -1;
if (spec.length == 1 && isInt(spec[0]))
return Integer.valueOf(spec[0]);
if (!spec[0].contains(":") && !spec[0].contains("."))
if (spec.length == 2) {
if (!isInt(spec[0]))