client: fix mix of spaces & tabs

This commit is contained in:
Philippe Teuwen 2019-03-09 23:35:06 +01:00
commit 0d9223a547
197 changed files with 49383 additions and 49383 deletions

View file

@ -37,45 +37,45 @@ int getopt(int argc, char *argv[], const char *optstring)
char *str;
if (pos == 0) {
if ((optind >= argc) || (*argv[optind] != '-'))
return EOF;
pos = 1;
if (argv[optind][pos] == '\0')
return EOF;
if ((optind >= argc) || (*argv[optind] != '-'))
return EOF;
pos = 1;
if (argv[optind][pos] == '\0')
return EOF;
}
str = strchr(optstring, argv[optind][pos]);
if (str == NULL) {
optopt = argv[optind][pos];
if (opterr)
fprintf(stderr, "%s: illegal option -- %c\n", argv[0],
optopt);
return '?';
optopt = argv[optind][pos];
if (opterr)
fprintf(stderr, "%s: illegal option -- %c\n", argv[0],
optopt);
return '?';
}
if (str[1] == ':') {
if (argv[optind][pos+1] != '\0') {
optarg = &argv[optind][pos+1];
return *str;
}
optind++;
if (optind >= argc) {
optopt = *str;
if (opterr)
fprintf(stderr, "%s: option requires an argument -- %c\n",
argv[0], optopt);
return '?';
}
optarg = argv[optind];
optind++; pos = 0;
return *str;
if (argv[optind][pos+1] != '\0') {
optarg = &argv[optind][pos+1];
return *str;
}
optind++;
if (optind >= argc) {
optopt = *str;
if (opterr)
fprintf(stderr, "%s: option requires an argument -- %c\n",
argv[0], optopt);
return '?';
}
optarg = argv[optind];
optind++; pos = 0;
return *str;
}
else {
pos++;
if (argv[optind][pos] == '\0') {
optind++;
pos = 0;
}
return *str;
pos++;
if (argv[optind][pos] == '\0') {
optind++;
pos = 0;
}
return *str;
}
}