Fossil

Check-in [d8b23d71c9]
Login

Check-in [d8b23d71c9]

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fixing the long opt broke final short option if expected argument is not present.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | find-options-last-arg-fix
Files: files | file ages | folders
SHA3-256: d8b23d71c9161c943c021630b0899672ef4b9f094ed0934226c0c0fa30956124
User & Date: preben 2023-09-29 06:56:27.614
Context
2023-09-29
13:35
merge in find-options-last-arg-fix ... (check-in: ad0b5f0e2d user: preben tags: trunk)
06:56
Fixing the long opt broke final short option if expected argument is not present. ... (Closed-Leaf check-in: d8b23d71c9 user: preben tags: find-options-last-arg-fix)
2023-09-28
18:59
Handle --opt=arg as final command line argument, discussed in [forum:a90b5ebd36f4c134]. ... (check-in: 9ac38481ec user: preben tags: find-options-last-arg-fix)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/main.c.
1045
1046
1047
1048
1049
1050
1051

1052
1053
1054
1055
1056
1057
1058
      }else if( z[nLong]==0 ){
        if( i+hasArg >= g.argc ) break;
        zReturn = g.argv[i+hasArg];
        remove_from_argv(i, 1+hasArg);
        break;
      }
    }else if( fossil_strcmp(z,zShort)==0 ){

      zReturn = g.argv[i+hasArg];
      remove_from_argv(i, 1+hasArg);
      break;
    }
  }
  return zReturn;
}







>







1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
      }else if( z[nLong]==0 ){
        if( i+hasArg >= g.argc ) break;
        zReturn = g.argv[i+hasArg];
        remove_from_argv(i, 1+hasArg);
        break;
      }
    }else if( fossil_strcmp(z,zShort)==0 ){
      if( i+hasArg >= g.argc ) break;
      zReturn = g.argv[i+hasArg];
      remove_from_argv(i, 1+hasArg);
      break;
    }
  }
  return zReturn;
}