Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Unified Diff: source/tools/toolutil/uoptions.c

Issue 1621843002: ICU 56 update step 1 (Closed) Base URL: https://chromium.googlesource.com/chromium/deps/icu.git@561
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « source/tools/toolutil/udbgutil.cpp ('k') | source/tools/tzcode/icuregions » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/tools/toolutil/uoptions.c
diff --git a/source/tools/toolutil/uoptions.c b/source/tools/toolutil/uoptions.c
index 05efc170cbdf7513dd57ebf7779b982e97a21d94..291e2fce4e7fb88cebfb0375901bc691c8742a76 100644
--- a/source/tools/toolutil/uoptions.c
+++ b/source/tools/toolutil/uoptions.c
@@ -1,7 +1,7 @@
/*
*******************************************************************************
*
-* Copyright (C) 2000, International Business Machines
+* Copyright (C) 2000-2015, International Business Machines
* Corporation and others. All Rights Reserved.
*
*******************************************************************************
@@ -60,9 +60,16 @@ u_parseArgs(int argc, char* argv[],
option->value=argv[++i];
} else if(option->hasArg==UOPT_REQUIRES_ARG) {
/* there is no argument, but one is required: return with error */
+ option->doesOccur=0;
return -i;
}
}
+
+ if(option->optionFn!=NULL && option->optionFn(option->context, option)<0) {
+ /* the option function was called and returned an error */
+ option->doesOccur=0;
+ return -i;
+ }
}
} else {
/* process one or more short options */
@@ -95,21 +102,23 @@ u_parseArgs(int argc, char* argv[],
break;
} else if(option->hasArg==UOPT_REQUIRES_ARG) {
/* there is no argument, but one is required: return with error */
+ option->doesOccur=0;
return -i;
}
}
+ if(option->optionFn!=NULL && option->optionFn(option->context, option)<0) {
+ /* the option function was called and returned an error */
+ option->doesOccur=0;
+ return -i;
+ }
+
/* get the next option letter */
option=NULL;
c=*arg++;
} while(c!=0);
}
- if(option!=0 && option->optionFn!=0 && option->optionFn(option->context, option)<0) {
- /* the option function was called and returned an error */
- return -i;
- }
-
/* go to next argv[] */
++i;
} else {
« no previous file with comments | « source/tools/toolutil/udbgutil.cpp ('k') | source/tools/tzcode/icuregions » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698