commit a41d1a3089a0311f3d30642ff7435d0c71c87ada Author: vaydheesh Date: Thu Jul 11 10:50:44 2019 +0530 Set optind in constructor diff --git a/apertium/tagger.cc b/apertium/tagger.cc index 468dff0..996b1bf 100644 --- a/apertium/tagger.cc +++ b/apertium/tagger.cc @@ -16,6 +16,8 @@ apertium_tagger::apertium_tagger(int &argc, char **&argv) TheFunctionTypeType(), TheUnigramType(), TheFunctionType(), TheFunctionTypeOptionArgument(0), TheFlags() { try { + /*Set optind so that multiple instances can be created */ + optind = 1; while (true) { The_val = getopt_long(argc, argv, "bdfegmpr:s:t:u:wxz", longopts, &The_indexptr);