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

Unix.system (Win) should report when cmd.exe is not found #7088

Closed
vicuna opened this issue Dec 13, 2015 · 3 comments
Closed

Unix.system (Win) should report when cmd.exe is not found #7088

vicuna opened this issue Dec 13, 2015 · 3 comments

Comments

@vicuna
Copy link

vicuna commented Dec 13, 2015

Original bug ID: 7088
Reporter: @Chris00
Status: acknowledged (set by @damiendoligez on 2017-04-13T11:12:05Z)
Resolution: open
Priority: normal
Severity: minor
Platform: x86_64
OS: Windows
Version: 4.02.3
Category: otherlibs
Monitored by: @hcarty @Chris00

Bug description

The API call system¹ documentation says "If the command interpreter is not found, returns 0 and sets errno to ENOENT." It seems that this behavior is not taken into account by the C function win_system.

¹ https://msdn.microsoft.com/en-us/library/277bwbdz.aspx

Additional information

See #349

@vicuna
Copy link
Author

vicuna commented Apr 13, 2017

Comment author: @damiendoligez

Note that the Microsoft documentation referenced above is self-contradictory: it says the return value will be both 0 and -1 when cmd.exe is not found.

@nojb nojb added the windows label Mar 15, 2019
@vicuna vicuna added the bug label Mar 20, 2019
@github-actions
Copy link

github-actions bot commented May 9, 2020

This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc.

@github-actions github-actions bot added the Stale label May 9, 2020
@xavierleroy
Copy link
Contributor

I think this is the wrong reading of the MSDN documentation. Let me rewrite it in structured programming style:

If command is NULL:

  • if the command interpreter is found, returns a nonzero value
  • If the command interpreter is not found, returns 0 and sets errno to ENOENT.

If command is not NULL, system returns the value that is returned by the command interpreter.

  • It returns the value 0 only if the command interpreter returns the value 0.
  • A return value of - 1 indicates an error, and errno is set to one of the following values: ... ENOENT The command interpreter cannot be found.

We're in case "command is not NULL", and there is no problem.

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

No branches or pull requests

3 participants