|
@@ -36,19 +36,16 @@ static int getint(const char **p)
|
|
return x;
|
|
return x;
|
|
}
|
|
}
|
|
|
|
|
|
-static int getsigned(const char **p)
|
|
|
|
|
|
+static int getoff(const char **p)
|
|
{
|
|
{
|
|
|
|
+ int neg = 0;
|
|
if (**p == '-') {
|
|
if (**p == '-') {
|
|
++*p;
|
|
++*p;
|
|
- return -getint(p);
|
|
|
|
|
|
+ neg = 1;
|
|
|
|
+ } else if (**p == '+') {
|
|
|
|
+ ++*p;
|
|
}
|
|
}
|
|
- if (**p == '+') ++*p;
|
|
|
|
- return getint(p);
|
|
|
|
-}
|
|
|
|
-
|
|
|
|
-static int getoff(const char **p)
|
|
|
|
-{
|
|
|
|
- int off = 3600*getsigned(p);
|
|
|
|
|
|
+ int off = 3600*getint(p);
|
|
if (**p == ':') {
|
|
if (**p == ':') {
|
|
++*p;
|
|
++*p;
|
|
off += 60*getint(p);
|
|
off += 60*getint(p);
|
|
@@ -57,7 +54,7 @@ static int getoff(const char **p)
|
|
off += getint(p);
|
|
off += getint(p);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- return off;
|
|
|
|
|
|
+ return neg ? -off : off;
|
|
}
|
|
}
|
|
|
|
|
|
static void getrule(const char **p, int rule[5])
|
|
static void getrule(const char **p, int rule[5])
|