Changeset e54a746


Ignore:
Timestamp:
May 13, 2010, 3:02:03 PM (14 years ago)
Author:
Nelson Elhage <nelhage@mit.edu>
Branches:
master, release-1.10, release-1.7, release-1.8, release-1.9
Children:
ff426f9
Parents:
88e425f
git-author:
Nelson Elhage <nelhage@mit.edu> (05/13/10 14:19:38)
git-committer:
Nelson Elhage <nelhage@mit.edu> (05/13/10 15:02:03)
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

    r88e425f re54a746  
    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.