Changeset 935b8d8


Ignore:
Timestamp:
May 24, 2010, 8:22:54 PM (10 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
release-1.6
Children:
258a3bf
Parents:
51a56b3
git-author:
Nelson Elhage <nelhage@mit.edu> (05/13/10 14:19:38)
git-committer:
Nelson Elhage <nelhage@mit.edu> (05/24/10 20:22:54)
Message:
owl_command_smartnarrow: Correctly initalize optind.

If we don't reset optind, the first time someone runs smartnarrow,
we'll start scanning arguments wherever the getopt() at startup left
off.

Signed-off-by: Nelson Elhage <nelhage@mit.edu>
File:
1 edited

Legend:

Unmodified
Added
Removed
  • commands.c

    r51a56b3 r935b8d8  
    13031303    {"related",  0, 0, 'r'},
    13041304    {NULL,       0, 0, 0}};
     1305
     1306  optind = 0;
    13051307  while ((opt = getopt_long(argc, tmp_argv, "ir", options, NULL)) != -1) {
    13061308    switch (opt) {
     
    13271329  owl_free(tmp_argv);
    13281330
    1329   optind = 0; /* reset getopt */
    13301331  return NULL;
    13311332}
Note: See TracChangeset for help on using the changeset viewer.