aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
Commit message (Collapse)AuthorAge
...
* restyle highlight module to match project styleGravatar Kurtis Rader2016-04-30
| | | | | | Reduces lint errors from 176 to 69 (-61%). Line count from 1627 to 1426 (-12%). Another step in resolving issue #2902.
* restyle function module to match project styleGravatar Kurtis Rader2016-04-30
| | | | | | Reduces lint errors from 39 to 27 (-31%). Line count from 619 to 498 (-20%). Another step in resolving issue #2902.
* restyle fish modules to match project styleGravatar Kurtis Rader2016-04-30
| | | | | | Reduces lint errors from 60 to 60 (-0%). Line count from 5599 to 4925 (-12%). Another step in resolving issue #2902.
* restyle fallback module to match project styleGravatar Kurtis Rader2016-04-30
| | | | | | | | | | Reduces lint errors from 36 to 33 (-8%). Line count from 1910 to 1476 (-23%). Another step in resolving issue #2902. This also fixes a stupid mistake from an earlier commit where I didn't realize that osx/config.h was meant to be included as a semi-static file in the repository.
* Remove use of __environGravatar ridiculousfish2016-04-30
| | | | It has apparently never worked. Fixes #2988
* Remove some unused macros from builtin_set_color.cppGravatar ridiculousfish2016-04-29
|
* Issue a \r in fish_title, except when executing it for the promptGravatar ridiculousfish2016-04-29
| | | | | | | | | | | fish_title currently outputs some escaped text, which can confuse the line driver (#2453). Issue a carriage return so the line driver knows we are at the beginning of the line, unless we are writing the title as part of the prompt. In that case, we may have text from the previous command still on the line and we don't want to move the cursor. Fixes #2453
* restyle expand module to match project styleGravatar Kurtis Rader2016-04-28
| | | | | | Reduces lint errors from 183 to 126 (-31%). Line count from 2231 to 1787 (-20%). Another step in resolving issue #2902.
* restyle exec module to match project styleGravatar Kurtis Rader2016-04-28
| | | | | | Reduces lint errors from 121 to 59 (-51%). Line count from 1578 to 1290 (-18%). Another step in resolving issue #2902.
* retyle event module to match project styleGravatar Kurtis Rader2016-04-28
| | | | | | Reduces lint errors from 39 to 30 (-23%). Line count from 915 to 670 (-27%). Another step in resolving issue #2902.
* restyle env_universal module to match project styleGravatar Kurtis Rader2016-04-28
| | | | | | Reduces lint errors from 121 to 52 (-57%). Line count from 1916 to 1671 (-13%). Another step in resolving issue #2902.
* restyle env module to match project styleGravatar Kurtis Rader2016-04-28
| | | | | | Reduces lint errors from 90 to 72 (-20%). Line count from 1719 to 1298 (-24%). Another step in resolving issue #2902.
* provide a realpath implementationGravatar Kurtis Rader2016-04-28
| | | | | | | Not all distros have a `realpath` command. Provide a function that uses the real command if available else use the fish builtin. Fixes #2932
* restyle common module to match project styleGravatar Kurtis Rader2016-04-27
| | | | | | Reduces lint errors from 194 to 142 (-27%). Line count from 3352 to 2645 (-21%). Another step in resolving issue #2902.
* restyle color module to match project styleGravatar Kurtis Rader2016-04-27
| | | | | | Reduces lint errors from 16 to 14 (-13%). Line count from 558 to 463 (-17%). Another step in resolving issue #2902.
* compile fallback.cpp and util.cpp seperatelyGravatar Kurtis Rader2016-04-27
| | | | | | | Don't `#include "*.cpp"` modules in other cpp modules. I already took care of all the builtin_*.cpp modules in my previous change where I restyled the builtin code. This change fixes the two remaining instances of this anti-pattern.
* env_universal_common.cpp: pass correct flag to fcntlGravatar David Adam2016-04-27
| | | | | | Closes #2955. (cherry picked from commit d5797c543982a0fbc8201ae21db5009e9447f75d)
* restyle builtin modules to match project styleGravatar Kurtis Rader2016-04-26
| | | | | | | | | | | Now that the IWYU cleanup has been merged compile all, not just a couple, of the builtin modules independent of builtin.cpp. That is, no longer `#include builtin_NAME.cpp` in builtin.cpp. This is more consistent, more in line with what developers expect, and is likely to reduce mistakes. Reduces lint errors from 384 to 336 (-13%). Line count from 6307 to 4988 (-21%). Another step in resolving issue #2902.
* Update usage of pcre2_substitute() for pcre2-10.21Gravatar Michael Steed2016-04-27
| | | | | | | - Set PCRE2_SUBSTITUTE_OVERFLOW_LENGTH to get the required buffer length from pcre2 instead of guessing - Set PCRE2_SUBSTITUTE_EXTENDED to enable extra goodies in the replacement string
* add better support for IWYU and fix thingsGravatar Kurtis Rader2016-04-26
| | | | | | | | | Remove the "make iwyu" build target. Move the functionality into the recently introduced lint.fish script. Fix a lot, but not all, of the include-what-you-use errors. Specifically, it fixes all of the IWYU errors on my OS X server but only removes some of them on my Ubuntu 14.04 server. Fixes #2957
* make comments Xcode friendlyGravatar Kurtis Rader2016-04-19
| | | | | | The OS X Xcode IDE has a weird requirement that block comments preceding a function or class definition must begin with three slashes rather than two if you want the comment displayed in the "Quick Help" window.
* restyle autoload module to match project styleGravatar Kurtis Rader2016-04-18
| | | | | | Reduces lint errors from 38 to 19 (-50%). Line count from 506 to 426 (-16%). Another step in resolving issue #2902.
* restyle builtin module to match project styleGravatar Kurtis Rader2016-04-18
| | | | | | Reduces lint errors from 271 to 215 (-21%). Line count from 4304 to 3242 (-25%). Another step in resolving issue #2902.
* restyle history code to match project styleGravatar Kurtis Rader2016-04-18
| | | | | | | | | | | | | | | | | | | | | | | Make the history code conform to the new style guide. Every change was produced by clang-format (e.g., `make style`) with the exception of comments which were manually reformatted. That has to be done by hand since clang-format leaves comments alone other than to reflow comment lines to get them below the allowed line length. The total number of lines is reduced by 313 lines (13%) in the two affected files. Line count is generally a poor metric but in this case it reflects an increase in information density without a loss in readability. Furthermore, the standardization of braces, whitespace, and comment style will make it easier for people to read the code. This reduces the number of warnings by `make lint` from 168 to 87 (a 48% decrease). Making it much easier to focus on the substantive lint issues. Further improvements are possible. For example, many comments are not very helpful (e.g., they point out the obvious) or provide insufficient detail. But those are beyond the scope of this change. This is the first step in resolving issue #2902.
* fix off by one errorGravatar Kurtis Rader2016-04-13
|
* fish handling of readlink()Gravatar Kurtis Rader2016-04-12
| | | | | | | | | | | | 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.
* revert inadvertent file inclusion in prior commitGravatar Kurtis Rader2016-04-12
| | | | | Commit 6431c0de16937622a2664c417f517d002220e017 was not meant to include changes to fish.cpp.
* fix bug in lint.fish helper scriptGravatar Kurtis Rader2016-04-12
| | | | | | | 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.
* another wcstring to wchar_t * changeGravatar Kurtis Rader2016-04-10
| | | | | | | | | | | 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.
* enhance fish_indent to normalize keywordsGravatar Kurtis Rader2016-04-10
| | | | | | | | | | | 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
* Change parser_token_types from wcstring to const wchar_t *Gravatar ridiculousfish2016-04-10
| | | | Reduces allocations and startup time
* Fix #2919 by removing the entire block.Gravatar Aaron Gyes2016-04-09
| | | | | | | | | | | | | | 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
* fix handling of line continuation in keywordsGravatar Jak Wings2016-04-08
| | | | | | | This behavior is more consistent with line continuation in strings other than keywords. Fixes #2897
* add missing special-case for ../Gravatar Kurtis Rader2016-04-08
| | | | | When I reviewed the fix for #952 I noted that "../" wasn't handled but in my haste to merge it forgot to augment the pull-request.
* Migrate PATH-completion logic from complete.cpp to expand.cppGravatar ridiculousfish2016-04-07
| | | | | | | | | | | | | | | | 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
* Implement an --invert/-v for string match, like grep -v.Gravatar Aaron Gyes2016-04-08
| | | | Only lines that do not match the pattern are shown.
* Complain less about "bogus" PATH entriesGravatar ridiculousfish2016-04-07
| | | | | | 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.
* Remove a dead function bool_from_env_varGravatar ridiculousfish2016-04-07
|
* fix setting of $argv for `source` w/no argsGravatar Kurtis Rader2016-04-06
| | | | Fixes #139
* change how redirections are formattedGravatar Kurtis Rader2016-04-05
| | | | | | | | 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
* don't try to use st_gen (inode generation) numberGravatar Aaron Gyes2016-04-04
| | | | | | | | | Per discussion in pull-request #2891, it's not available on Linux (we just fill it with zero), and unless run as root on OS X (or other BSD system) it will be zero. Remove it from file_id_t. Also fix the initialization of the file_id_t structure. Fixes #2891
* remove unused special color "ignore"Gravatar Kurtis Rader2016-04-04
| | | | | | Resolve lint warning about unused method "rgb_color_t::ignore()". Fixes #2893
* fixes for cppcheck lint warningsGravatar Kurtis Rader2016-04-04
| | | | | | Refine the linting behavior. Fix several of the, mostly trivial, lint errors.
* convert atypical env_universal_common loggingGravatar Kurtis Rader2016-04-03
| | | | | | | | | | This is a quick and dirty conversion of the atypical, and undocumented, logging done by env_universal_common.cpp to the usual `debug()` pattern. I didn't want to drop the messages because they could be useful when debugging future issues. So I simply converted them to the lowest debug level using the normal debug() function. Fixes #2887
* lint: remove or comment out unused functionsGravatar Kurtis Rader2016-04-03
| | | | | | Cppcheck has identified a lot of unused functions. This removes funcs that are unlikely to ever be used. Others that might be useful for debugging I've commented out with "#if 0".
* remove unused wgetopt() method found by lintingGravatar Kurtis Rader2016-04-02
|
* Remove an unnecessary c_str()Gravatar ridiculousfish2016-03-27
|
* Fix memory leaks at exit found in testsGravatar Andreas Nordal2016-03-27
| | | | | | | | | | This fixes all memory leaks found by compiling with clang++ -g -fsanitize=address and running the tests. Method: Ensure that memory is freed by the destructor of its respective container, either by storing objects directly instead of by pointer, or implementing the required destructor.
* `fish --version` should write to stdoutGravatar Kurtis Rader2016-03-23
| | | | | | | | | When explicitly asking for the fish version string the information should go to stdout rather than stderr. Also, there is no reason to use exit_without_destructors() rather than exit() in that code path. We actually want the side-effects of exit() such as flushing stdout and there aren't any threads or other things that could cause a normal exit to fail when that function is run.
* Fix memory leak, error message when failing to open input fileGravatar Andreas Nordal2016-03-22
| | | | | | | | | | | | | The early return skipped all cleanup. This problem is a case for the classic "goto fail" paradigm, but this change instead makes a few adjustments to take advantage of a previously unused level of indentation to conditionally execute the success path. The error message now prints the filename instead of "open", which should be more idiomatic. Tip: This patch makes sense if viewed with `git show --ignore-space-change`.