commit | 49fd5d262c6764b0a6746cfdb267e8bebec49256 | [log] [tgz] |
---|---|---|
author | Jerry Zhang <zhangjerry@google.com> | Thu May 17 12:54:41 2018 -0700 |
committer | Jerry Zhang <zhangjerry@google.com> | Thu May 17 19:56:42 2018 +0000 |
tree | 14fadf8929d56faab3e82f6c82f2702d3557ffc2 | |
parent | 2ddc54f5fd1f3ae07c2c363c37561133eb161258 [diff] [blame] |
recovery: Reset optind to 1 after getopt The getopt library exposes optind which is the next index to be processed. When scanning is restarted, optind has to be reset to 1. Test: Recovery works Bug: 78793464 Change-Id: I1efca3fb985ffbdfe91e43767469733cda6e7d5b
diff --git a/recovery.cpp b/recovery.cpp index b1a2900..21f6330 100644 --- a/recovery.cpp +++ b/recovery.cpp
@@ -1049,6 +1049,7 @@ continue; } } + optind = 1; printf("stage is [%s]\n", stage.c_str()); printf("reason is [%s]\n", reason);