Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Updated the description of the --block-size option.
[rsync/rsync.git]
/
options.c
diff --git
a/options.c
b/options.c
index
a27e68b
..
c4db5ed
100644
(file)
--- a/
options.c
+++ b/
options.c
@@
-439,8
+439,10
@@
void option_error(void)
static void set_refuse_options(char *bp)
{
struct poptOption *op;
static void set_refuse_options(char *bp)
{
struct poptOption *op;
- char *cp;
- int match_short, is_wild;
+ char *cp, shortname[2];
+ int is_wild;
+
+ shortname[1] = '\0';
while (1) {
while (*bp == ' ') bp++;
while (1) {
while (*bp == ' ') bp++;
@@
-451,8
+453,7
@@
static void set_refuse_options(char *bp)
/* If they specify "delete", reject all delete options. */
if (strcmp(bp, "delete") == 0)
bp = "delete*";
/* If they specify "delete", reject all delete options. */
if (strcmp(bp, "delete") == 0)
bp = "delete*";
- match_short = !bp[1] && *bp != '*';
- is_wild = !match_short && strpbrk(bp, "*?[") != NULL;
+ is_wild = strpbrk(bp, "*?[") != NULL;
for (op = long_options; ; op++) {
if (!op->longName) {
rprintf(FLOG,
for (op = long_options; ; op++) {
if (!op->longName) {
rprintf(FLOG,
@@
-460,8
+461,8
@@
static void set_refuse_options(char *bp)
bp);
break;
}
bp);
break;
}
- if (match_short ? *bp == op->shortName
-
: wildmatch(bp, op->longN
ame)) {
+ *shortname = op->shortName;
+
if (wildmatch(bp, op->longName) || wildmatch(bp, shortn
ame)) {
op->val = (op - long_options) + OPT_REFUSED_BASE;
if (!is_wild)
break;
op->val = (op - long_options) + OPT_REFUSED_BASE;
if (!is_wild)
break;