aboutsummaryrefslogtreecommitdiffhomepage
path: root/expand.cpp
Commit message (Collapse)AuthorAge
* Pass the character index, not the character, to parse_util_expand_variable_errorGravatar ridiculousfish2015-05-15
| | | | Fixes #2067
* Rework error messages to be shorter and to handle more special bash-ismsGravatar ridiculousfish2015-04-29
| | | | | | Example: we can point $* to argv Fixes #1288
* Use natural (digit-sequence-aware) sorting for wildcard expansionGravatar ridiculousfish2015-03-23
| | | | Fixes #1993
* Stop leaking the result of wrealpathGravatar ridiculousfish2015-01-20
|
* expand: expand tilde to canonical pathsGravatar David Adam2014-10-26
| | | | Work on #1133.
* Remove EXPAND_SKIP_PROCESS, which did not actually workGravatar ridiculousfish2014-10-15
|
* Support space separators for abbreviations as part of #731Gravatar ridiculousfish2014-10-11
|
* Escape the error string in process expansion errorsGravatar Kevin Ballard2014-09-25
| | | | | | | This prevents `echo %*` from printing a private-use character in the error string. Fixes #1720.
* Fix the assertion failure in expand_variables()Gravatar Kevin Ballard2014-08-28
| | | | | | | | | | | | | | | | | expand_variables() is slightly confused about how to handle last_idx. On input, it expects it to be the index to start processing at, but when called recursively it always passes the current index. This means that it may sometimes pass an index 1 past the end of the input string. Notably, that happens when typing something like > echo "$foo (where "foo" is any string that is not a prefix of some existing variable name) Fix this by explicitly defining last_idx as being the last processed index, meaning the next index to process is actually last_idx-1. This means we should call it with next.size() instead of next.size()-1.
* Clean up variable expansion, and properly handle embedded NULsGravatar ridiculousfish2014-08-24
|
* Fix error span for invalid slice indexesGravatar Kevin Ballard2014-08-21
| | | | | | | | The span now properly points at the token that was invalid, rather than the start of the slice. Also fix the span for `()[1]` and `()[d]`, which were previously reporting no source location at all.
* Parse slices even for empty variablesGravatar Kevin Ballard2014-08-20
| | | | | | | | | | | | | When a variable is parsed as being empty, parse out the slice and validate the indexes anyway, behaving for slicing purposes as if the variable had a single empty value. Besides providing errors when expected, this also fixes the following: set -l foo echo "$foo[1]" This used to print "[1]", now it properly prints nothing.
* Fix double expansions (`$$foo`)Gravatar Kevin Ballard2014-08-20
| | | | | | | | | | | | | | | | | | | | | | Double expansions of variables had the following issues: * `"$$foo"` threw an error no matter what the value of `$foo` was. * `set -l foo ''; echo $$foo` threw an error because of the expansion of `$foo` to `''`. With this change, double expansion always works properly. When double-expanding a multi-valued variable, in a double-quoted string the first word of the inner expansion is used for the outer expansion, and outside of a quoted string every word is used for the double-expansion in each of the arguments. > set -l foo bar baz > set -l bar one two > set -l baz three four > echo "$$foo" one two baz > echo $$foo one two three four
* Fix small misspelling in comment in expand.cppGravatar Konrad Borowski2014-05-31
|
* Implement correct error message for failed process expansion.Gravatar ridiculousfish2014-05-30
|
* Run restyle.sh to enforce style rules.Gravatar ridiculousfish2014-03-31
|
* Excise use of parser_t's error() functionality. Thread aGravatar ridiculousfish2014-03-21
| | | | | | parse_error_list_t through all of the expand functions, enabling them to report errors more directly. Improve aspects of error reporting for expansion failures.
* Fixed various Undefined Behavior occurrences.Gravatar Daniel J. Hofmann2014-03-07
| | | | | | | | | | | | | | | | | Conditionally uninitialized: - builtin_commandline.cpp:577 - expand.cpp:869 - parse_util.cpp:1036 Initialization of POD structs: - event.cpp:61 - autoload.cpp:22 References used with va_start: - common.cpp:608:18 Found with clang-3.4's awesome -Wconditional-uninitialized, -Wmissing-field-initializers and -Wvarargs.
* Support for error detection in arguments in new parser. Restores errorGravatar ridiculousfish2014-03-04
| | | | reporting for bad arguments (e.g. with bad variable names)
* Revert "Merge pull request #1317 from pullreq/cpp"Gravatar ridiculousfish2014-02-28
| | | | | | | This reverts commit 74135c0600d5dcc40d396d0e7293c17b8d4bdaa7, reversing changes made to 6d749789ce240a3e6f1447777db63fd8e7525560. See discussion in #1317
* Fixes .c -> .cpp in comments. For doxygen.Gravatar Geoff Nixon2014-02-27
|
* Update style and formatting to conform to fish style guide.Gravatar ridiculousfish2014-01-15
|
* Miscellaneous optimizations to reduce string copyingGravatar ridiculousfish2014-01-07
|
* Bringup of function definitions, switch statements with new parserGravatar ridiculousfish2013-12-27
|
* Various cleanup and tweaking of backtrace messagesGravatar ridiculousfish2013-12-16
|
* Allow autosuggestions to do job expansion. FixesGravatar ridiculousfish2013-11-29
| | | | https://github.com/fish-shell/fish-shell/issues/1152
* Large cleanup and refactoring of unescape() function.Gravatar ridiculousfish2013-11-24
|
* Fix formattingGravatar ridiculousfish2013-10-26
|
* Improve dangerous/undefined PID expansion behaviorGravatar Ryan Hileman2013-09-22
| | | | | | | | | | | | | | | | | | | | | | | | 1. Use Bash-like expansion for empty searches (when you just use a '%' by itself). '%' will now *only* match the last valid backgrounded process. If there are no such processes, an expansion error will be generated. '%' by itself would previously match either *all* backgrounded processes, or failing that, all processes owned by your user. If you ever tried to run `kill -9 %`, it would either kill all backgrounded processes or *all* of your processes. I'm not sure why anyone would ever want that to be a single keystroke away. You could almost typo it. As a result, `fg %`, `bg %`, `kill %`, etc will all operate on the last process touched by job control. 2. Don't run 'by-name' matches when the search term is numeric. This prevents you from running a command like `kill %1` and accidentally killing a process named something like "1Command". Overloaded behavior can be dangerous, and we probably shouldn't play fast and loose with expansion characters that generate process IDs.
* Don't do completions or autosuggestions for commands with wildcards.Gravatar ridiculousfish2013-09-11
| | | | Fixes https://github.com/fish-shell/fish-shell/issues/785
* Adjust prefix completions to sort alphabetically instead of by length.Gravatar ridiculousfish2013-08-31
| | | | | Other completions are still sorted by length. https://github.com/fish-shell/fish-shell/issues/923
* Initial abbreviation work. Tests currently fail.Gravatar ridiculousfish2013-07-19
|
* Make parse_util_locate_cmdsubst return the innermost command substitution ↵Gravatar ridiculousfish2013-07-17
| | | | | | instead of the outermost. Fixes https://github.com/fish-shell/fish-shell/issues/913
* Conditionally include sys/sysctl.hGravatar Ian Ray2013-06-01
|
* Formatting and style updatesGravatar ridiculousfish2013-05-05
|
* Fix for issue where tab completing an empty string would produce no resultsGravatar ridiculousfish2013-04-21
|
* Teach case-insensitive completions about tildes. Fixes ↵Gravatar ridiculousfish2013-04-07
| | | | https://github.com/fish-shell/fish-shell/issues/647
* Add some headers to fix the build on OpenBSDGravatar ridiculousfish2013-03-11
| | | | https://github.com/fish-shell/fish-shell/issues/616
* Make subcommands modify $status, and make builtin_set not modify status ↵Gravatar ridiculousfish2013-01-31
| | | | | | | unless it fails https://github.com/fish-shell/fish-shell/issues/547 https://github.com/fish-shell/fish-shell/issues/214
* Fix spelling: s/circut/circuit/gGravatar Cheer Xiao2013-01-24
|
* Fix two clang warningsGravatar Cheer Xiao2013-01-17
|
* FormattingGravatar ridiculousfish2013-01-12
|
* Don't call expand_home_directory from within parser_t::test - it may hangGravatar ridiculousfish2013-01-12
| | | | https://github.com/fish-shell/fish-shell/issues/512
* Hack around xdm's dumb assumption that the login shell is POSIX compliant so ↵Gravatar ridiculousfish2013-01-04
| | | | | | | we no longer kill OpenSUSE https://github.com/fish-shell/fish-shell/issues/367 Also fix some formatting
* Attempt to fix process expansion on LinuxGravatar ridiculousfish2012-12-18
| | | | Hopefully addresses https://github.com/fish-shell/fish-shell/issues/455
* Fixed compilation error in expand.cppGravatar situ2012-11-22
| | | | Fixed https://github.com/fish-shell/fish-shell/issues/401
* Fixed recursive brace expansionGravatar ridiculousfish2012-11-20
| | | | https://github.com/fish-shell/fish-shell/issues/399
* Fix indentation of switch statementsGravatar ridiculousfish2012-11-19
|
* Apply new indentation, brace, and whitespace styleGravatar ridiculousfish2012-11-18
|
* Remove trailing whitespaces and change tabs to spacesGravatar Łukasz Niemier2012-11-18
|