Changeset 86cf96d in mainline for uspace/app/bdsh/cmds/modules/ls/ls.c


Ignore:
Timestamp:
2015-04-29T12:40:14Z (10 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
e3811c9
Parents:
dcba819
git-author:
Luka Strižić <luka@…> (2015-04-29 12:40:14)
git-committer:
Jakub Jermar <jakub@…> (2015-04-29 12:40:14)
Message:

Set optreset before each option parsing
(Thanks to Luka Strižić)

bdsh modules such as ls can be used repeatedly within the lifetime of
the bdsh task. As such, they need to set the optreset variable before
each command line options evaluation.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/bdsh/cmds/modules/ls/ls.c

    rdcba819 r86cf96d  
    362362        argc = cli_count_args(argv);
    363363       
    364         for (c = 0, optind = 0, opt_ind = 0; c != -1;) {
     364        for (c = 0, optreset = 1, optind = 0, opt_ind = 0; c != -1;) {
    365365                c = getopt_long(argc, argv, "hur", long_options, &opt_ind);
    366366                switch (c) {
Note: See TracChangeset for help on using the changeset viewer.