# HG changeset patch # User Matti Hamalainen # Date 1353273153 -7200 # Node ID e37d7c1f8a0343b4732957921ffb7ad716af6c85 # Parent 34d58b0f2d525544f9e36b46a63e075478d3d110 Using strncmp() for long argument comparision with length of the option being checked against is not that smart, as it will sometimes match similarly prefixed long arguments incorrectly. Fixed. diff -r 34d58b0f2d52 -r e37d7c1f8a03 th_args.c --- a/th_args.c Mon Nov 12 20:54:03 2012 +0200 +++ b/th_args.c Sun Nov 18 23:12:33 2012 +0200 @@ -226,7 +226,7 @@ if (optList[i].optLong) { optLen = strlen(optList[i].optLong); - if (strncmp(currArg, optList[i].optLong, optLen) == 0) + if (strcmp(currArg, optList[i].optLong) == 0) optN = i; }