Commit Graph

13 Commits

Author SHA1 Message Date
ridiculousfish
d7b2576fb5 Mark short_options as const everywhere
These were needlessly mutable file-scoped variables.
2018-09-29 00:18:36 -04:00
ridiculousfish
acff2516d4 Straighten out some wchar_t** casts
Embrace the fact that builtins expect to modify their argv array and get rid
of a bunch of const.
2018-08-04 16:25:51 -07:00
David Adam
21890ccac7 function: restore '%self' functionality for --on-process-exit
One key use of process expansion, used in currently-shipped code, is for running a function on
current shell exit.

Restore the use of %self as a valid argument (and add `self`) and document this change.

(faho: Remove bare "self")
2018-05-08 11:17:07 +02:00
ridiculousfish
db33ed0fc7 Migrate some function properties into a shared_ptr
The idea is that we can return the shared pointer directly, avoiding
lots of annoying little getter functions that each need to take locks.
It also helps to pull together the data structures used to initialize
functions versus store them.
2018-02-12 10:52:55 -08:00
ridiculousfish
de23ce6ac1 Functions to store nodes
Prior to this fix, functions stored a string representation of their
contents. Switch them to storing a parsed source reference and the
tnode of the contents. This is part of an effort to avoid reparsing
a function's contents every time it executes.
2018-02-12 10:49:22 -08:00
Kurtis Rader
ec1e9ac98d standardize on builtin_missing_argument() 2017-07-01 14:03:47 -07:00
Kurtis Rader
4ef14ea6e2 another make style-all cleanup 2017-06-23 23:19:09 -07:00
Kurtis Rader
385e40540c fix issues with builtin_function()
This does several things. It fixes `builtin_function()` so that errors it
emits are displayed. As part of doing that I've removed the unnecessary
`out_err` parameter to make the interface like every other builtin.

This also fixes a regression introduced by #4000 which was attempting to
fix a bug introduced by #3649.

Fixes #4139
2017-06-18 12:55:14 -07:00
Kurtis Rader
af22bf3501 style cleanups (make style-all) 2017-06-16 21:01:57 -07:00
Kurtis Rader
37b8cfaeba avoid struct name clashes
Running the tests on travis revealed that some compilers (or at least
with some options) call the wrong struct constructor if there is more
than one struct with the same name but differing definitions.
2017-06-16 21:01:57 -07:00
Kurtis Rader
ffdabace5e more builtin style cleanup 2017-06-16 21:01:57 -07:00
Kurtis Rader
175570b7ed lint cleanup 2017-06-16 21:01:56 -07:00
Kurtis Rader
044f5512e2 split builtin function into its own module 2017-06-16 21:01:56 -07:00