-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Obtaining the current directory from C++ was implemented in d5bf60c. (This commit changes it back to how it was earlier.) It probably involves a system call. Better to use the environment variable in Bash and Zsh. Furthermore, in C++, the working directory is a wide-character string on Windows, so it cannot be safely printed to the error stream because it gets auto-configured to print narrow-character strings the moment the first item (which is a narrow-character string) gets printed. (Although GCC and Clang do not mess up the error stream, the C++ standard says that this might happen, because printing narrow- and wide-character strings to the same stream results in undefined behaviour, so I would rather not do that.) To convert a wide-character string to narrow character string, the standard recommends using dedicated text-processing libraries, having deprecated the standard library functions for the same in C++17 (https://stackoverflow.com/q/42946335). Why deal with all that headache when the shell can supply the current directory.
- Loading branch information
Showing
3 changed files
with
9 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters