Kaydet (Commit) 7dca155e authored tarafından Sander Vesik's avatar Sander Vesik

INTEGRATION: CWS ooo20040329 (1.1.92); FILE MERGED

2004/03/17 12:40:59 waratah 1.1.92.1: #i1858# add explicit int type where needed
include extra braces to make code more obvious for debugging
üst a3981e92
...@@ -13,10 +13,11 @@ int ...@@ -13,10 +13,11 @@ int
getopt(int argc, char *const argv[], const char *opts) getopt(int argc, char *const argv[], const char *opts)
{ {
static int sp = 1; static int sp = 1;
register c; register int c;
register char *cp; register char *cp;
if (sp == 1) if (sp == 1)
{
if (optind >= argc || if (optind >= argc ||
argv[optind][0] != '-' || argv[optind][1] == '\0') argv[optind][0] != '-' || argv[optind][1] == '\0')
return -1; return -1;
...@@ -26,6 +27,7 @@ int ...@@ -26,6 +27,7 @@ int
optind++; optind++;
return -1; return -1;
} }
}
optopt = c = argv[optind][sp]; optopt = c = argv[optind][sp];
if (c == ':' || (cp = strchr(opts, c)) == 0) if (c == ':' || (cp = strchr(opts, c)) == 0)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment