From: Marc Alff Date: August 26 2010 2:34pm Subject: bzr commit into mysql-5.5-bugfixing branch (marc.alff:3195) List-Archive: http://lists.mysql.com/commits/116888 Message-Id: <20100826143423.190CB45E80@linux-su11.site> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============6710197497529479505==" --===============6710197497529479505== MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline #At file:///home/malff/BZR_TREE/mysql-5.5-bugfixing-55873/ based on revid:marc.alff@stripped 3195 Marc Alff 2010-08-26 Implemented code review comments modified: mysys/my_getopt.c === modified file 'mysys/my_getopt.c' --- a/mysys/my_getopt.c 2010-08-26 00:59:28 +0000 +++ b/mysys/my_getopt.c 2010-08-26 14:34:18 +0000 @@ -511,35 +511,18 @@ int handle_options(int *argc, char ***ar { /* We are currently parsing a single argv[] argument - of the form "-XYZ", and parsing is done in multiple phases. - One or the argument found is not an option. + of the form "-XYZ". + One or the argument found (say Y) is not an option. + Hack the string "-XYZ" to make a "-YZ" substring in it, + and push that to the output as an unrecognized parameter. */ - if (optend == cur_arg) - { - /* - The first argument, "-X", is not an option - In this case, the entire argument "-XYZ" is rejected - from this phase, and preserved as is for later parsing. - */ - (*argv)[argvpos++]= *pos; - } - else - { - /* - We are in the middle of an "-XYZ" string already, - "-X" has already been parsed, and "Y" (pointed by optend) - is not an option. - Hack the string "-XYZ" to make a "-YZ" substring in it, - and push that to the next parsing phase. - */ - DBUG_ASSERT(optend > *pos); - DBUG_ASSERT(optend > cur_arg); - DBUG_ASSERT(optend <= *pos + strlen(*pos)); - DBUG_ASSERT(*optend); - optend--; - optend[0]= '-'; /* replace 'X' by '-' */ - (*argv)[argvpos++]= optend; - } + DBUG_ASSERT(optend > *pos); + DBUG_ASSERT(optend >= cur_arg); + DBUG_ASSERT(optend <= *pos + strlen(*pos)); + DBUG_ASSERT(*optend); + optend--; + optend[0]= '-'; /* replace 'X' or '-' by '-' */ + (*argv)[argvpos++]= optend; /* Do not continue to parse at the current "-XYZ" argument, skip to the next argv[] argument instead. --===============6710197497529479505== MIME-Version: 1.0 Content-Type: text/bzr-bundle; charset="us-ascii"; name="bzr/marc.alff@stripped" Content-Transfer-Encoding: 7bit Content-Disposition: inline # Bazaar merge directive format 2 (Bazaar 0.90) # revision_id: marc.alff@stripped # target_branch: file:///home/malff/BZR_TREE/mysql-5.5-bugfixing-\ # 55873/ # testament_sha1: bba635c4279c154ff7f8a506b7017073da793802 # timestamp: 2010-08-26 08:34:22 -0600 # base_revision_id: marc.alff@stripped\ # up5sxyz76l2gijha # # Begin bundle IyBCYXphYXIgcmV2aXNpb24gYnVuZGxlIHY0CiMKQlpoOTFBWSZTWTkIe7MAAdnfgAAUUP///3bi nnq////wUAQ609yOzcVUaO1hJJNKnmEaE2lPaNE2VPFPUzIhmpmmaUD1GQNEmm1SbYmJqaajTQeo NAA0aBoAAEomgU9J6EZFPRkmEAwAAmmgDRocwJiaDCZMmTIwmCaaZGJgCGASSTTQaBJsiegjU9qm NRkaADQbSA0Xa67Tvrh+F1acZDKkzCFdJpwVguQHWOWGp74EFQQHJHnz8fa/Vwl4ZH+/9z5fTAzM vzzMnSG5phgHdboHvgabmxHZLDWpUmfllI98CMuy2X4nVLc0XYUPeXQD31F7MsbGmDb0nFisrodW mwp7I+RyhTm08bsDk22zLTmdT67bfcMzEOajQreM7BGrpcvGHOtc8tZLn1RCL+i3G/RJfSJVpSNW IilfupyUEsm9XA9AMPEOcCd57laUyPYeFQrnAnxRU++nLB/mJaI7F4h1ZDYZNzOTZ7ZyZNXRxu6d kzuOlHCeeWVF/mS8SvrWFpZTMo0t8cKISJFW3yL4mvn2cwiGsIQH2uJ0PC2XJi8LzxIzRkWyPIY2 RoFYUltLjMV1TRlRsqrFHEhATLHUc5aSlA45Noq5Wt2YwzLVKO0hQ8khoKr9tF+cHWNObAjIF0xh rHiz7qAttYSUitmIDOCuUHAZZgoY5UKJT8c4B/8A6MSxD0sqKJaFKvEGwVKkyN02o6xijZps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