Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parse function in ParseArgs code problem #18

Closed
akakakakakaa opened this issue May 21, 2018 · 2 comments
Closed

parse function in ParseArgs code problem #18

akakakakakaa opened this issue May 21, 2018 · 2 comments
Labels

Comments

@akakakakakaa
Copy link

akakakakakaa commented May 21, 2018

I'm github newbie. I don't know well how to write issue. Sorry.

It's simple.

in parse function,

        for (int i = 0; i < args.Length; ++i)
        {
            if ((args[i][0] == '-' || args[i][0] == '/')
                && args[i].Length > 1
                && i + i < args.Length)

args.Length condition check i + i. It need to change i + 1.

and

            if (args[i].Contains("@"))
            {
                user = args[i].Substring(0, args[i].IndexOf('@'));

                host = args[i].Substring(args[i].IndexOf('@') + 1);
                if (host.Contains(":"))
                {
                    root = host.Substring(host.IndexOf(':') + 1);
                    host = host.Substring(0, host.IndexOf(':'));
                }
            }
            else
            {
                drive = args[i][0];
            }

in this code, drive changes to first character of last option.

Liryna added a commit that referenced this issue May 21, 2018
@Liryna
Copy link
Member

Liryna commented May 21, 2018

Hi @akakakakakaa ,

Thank you for your report.
Here is the two commit I did releated to this issue:
2478b00
09006d8

Is that alright for you ?

@Liryna Liryna added the bug label May 21, 2018
@akakakakakaa
Copy link
Author

akakakakakaa commented May 31, 2018

Ok, Thanks!

and when I use in win10, It is not working. But, I don't know why.

It's another issue. I'll search.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants