The readlink() function does not null terminate the path it returns.
Remove the OS X code that deals with a path buffer that is too short. For
one thing a loop isn't needed since we're told how big of a buffer
is required if the first _NSGetExecutablePath() call fails. But more
important it is so unlikely that the path will be longer than PATH_MAX
that if it is we should just give up.
Fixes 2931.
(cherry picked from commit 8e103c231e)
If there are uncommitted changes use `git-clang-format` to limit the style
fixups to the lines being modified.
Refuse to do a `make style-all` if there are uncommitted changes.
Include a fix for the parsing of `git status` output that was recently
incorporated into the lint.fish script.
The readlink() function does not null terminate the path it returns.
Remove the OS X code that deals with a path buffer that is too short. For
one thing a loop isn't needed since we're told how big of a buffer
is required if the first _NSGetExecutablePath() call fails. But more
important it is so unlikely that the path will be longer than PATH_MAX
that if it is we should just give up.
Fixes 2931.
I just noticed that depending on the state of your working tree there can be
one or more spaces after the modification token and the file name. If there is
more than one space that causes the `string split` to produce unexpected
output.
In keeping with the change made by @ridiculousfish earlier today modify
the `keyword_description()` function to return a const wchar_t pointer.
Also, simplify the `token_type_description()` function to use the recently
introduced mapping array. This changes the wording of many of the token
type descriptions. However, I can't see this as being a problem since
the original descriptions (e.g., "token_redirection") are no clearer to
someone not acquainted with the implementation.
Fish keywords can be quoted and split across lines. Prior to this change
`fish_indent` would retain such odd, obfuscated, formatting. This change
results in all keywords being converted to their canonical form.
This required fixing a bug: the keyword member of parse_node_t wasn't being
populated. This hadn't been noticed prior to now because it wasn't used.
Fixes#2921
This code represents only risk and does nothing useful for anything
that can compile fish.
In C++ situations where __STDC_VERSION__ is unset (as it should be),
fish was assuming we are on < C99 and setting it to __FUNCTION__.
Basically always, __PRETTY_FUNCTION__ ends up reaplaced by __FUNCTION__, this hurt
error message usefulness and richness.
__PRETTY_FUNCTION__: const thing::sub(int)
__FUNCTION__: sub
Prior to this fix, when completing a command that doesn't have a /, we
would prepend each component of PATH and then expand the whole thing. So
any special characters in the PATH would be interpreted when performing
tab completion.
With this fix, we pull the PATH resolution out of complete.cpp and
migrate it to expand.cpp. This unifies nicely with the CDPATH resolution
already in that file. This requires introducing a new expand flag
EXPAND_SPECIAL_FOR_COMMAND, which is analogous to EXPAND_SPECIAL_CD
(which is renamed to EXPAND_SPECIAL_FOR_CD). This flag tells expand to
resolve paths against PATH instead of the working directory.
Fixes#952
I believe apm must have been buggy - example output that I found online
showed `tr` was mangling paths with spaces in it. Should be fixed.
Also, use dscl on OS X in __fish_complete_users.fish like
__fish_print_users.fish already does.
When determining the old path, get the existing value in any scope,
not just the set scope. Also only complain about absolute paths:
relative paths are expected to be invalid sometimes.
Modify `fish_indent` to emit redirections without a space before the target of
the redirection; e.g., "2>&1" rather than "2>& 1" as the former is clearer to
humans.
Fixes#2899
Include information about how to deal with lint warnings and suppress
`clang-format` reformatting of blocks of code.
Move information only relevant to developers from the README.md to the
CONTRIBUTING.md document.
Closes#2901
I didn't notice when I merged commit cb6d5d76c8
by thebespokepixel.com that it removed the explicit wrapping in the `string`
man page. That makes `man string` harder to read so reinstate the explicit
wrapping.
This changes implements two new make targets: `style` and `style-all`. These
make it easy to ensure that a change conforms to the project style guides for
C++ and fish code.
Fixes#571