| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We revive the dead _wspawnvp code that was used on MinGW, a
platform that has not been supported for years, adapting it
for Cygwin.
* configure: Correct the _wspawnlp test; it should have been
testing for _wspawnvp function, which is what is is actually
used by the matching code. Moreover, the broken test was
calling _wspawnlp with _wspawnvp style arguments. Anyway, this
is moot because we will never detect this function in the
foreseeable future. More importantly, adding a test for
spawnvp, which exists on Cygwin.
* stream.c: Include the <process.h> header if HAVE_WSPAWN or
HAVE_SPAWN. This was missing before; how did the _wspawnvp
call ever compile?
(w_spawnvp): New static function.
(run): spawn version now calls either _wspawwnvp or w_spawnvp
if that is not available. We test for HAVE_WSPAWN or
HAVE_SPAWN first, before HAVE_FORK_STUFF, so that we use the
spawn function preferentially. On Cygwin, we have the fork
stuff.
|
|
|
|
|
|
|
|
|
|
| |
* sysif.c (validate_salt): Take const wchar_t * argument
instead of val. Set errno and return null pointer instead of
throwing, so we don't have two places that throw an exception
related to crypt.
(crypt_wrap): Put exception at the end. Return hash only if
validate_salt returns a non-null pointer and so does crypt.
In all other cases, reach exception call.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The crypt function on glibc, and maybe other platforms, simply
crashes when given a perfectly valid salt string that contains
invalid salt syntax. This is nasty; we want TXR Lisp
library functions to be robust; bringing down the image is not
acceptable.
Also, crypt may return a null pointer. glibc's crypt does
this in certain situations, like when the "2a" (Blowfish)
algorithm is specified when not available. We are not checking
for this null return, in which case the ensuing crash is our
fault.
* sysif.c (salt_char_p, validate_salt): New functions.
(crypt_wrap): Validate the salt via validate_salt.
Check the return value from crypt/crypt_r; if null,
then throw an exception that incorporates the errno
information.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When @(line var) is used in a horizontal match, line is bound
to zero. This is because the line number isn't being
propagated.
* match.c (mf_from_ml): Both the file and line context
structurs have a data_lineno, yet this function doesn't
propagate it. Instead of using ml_all, whose name
tells a subtle lie since it neglects the data_lineno,
let's just do the member for member logic here.
This function is used in one place, the hv_trampoline.
So this fixes the line number for all vertical directives
called out of horizontal context.
|
|
|
|
|
| |
* share/txr/stdlib/compiler.tl (compiler compile): If the form
isn't an atom, then consp is implied.
|
|
|
|
|
|
|
| |
* stream.c (w_fopen_mode): Fix diagnostic to refer to "m" mode
instead of "o" mode, adjusting the wording at the same time.
This is only compiled on platforms without HAVE_FCNTL;
basically nothing that TXR is commonly built for.
|
|
|
|
|
|
| |
* share/txr/stdlib/copy-file.tl: Remove execute permissions
that had been accidentally applied before this file was placed
under version control.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On Solaris, we can't set the sticky bit on a non-directory
without special privilege.
Let's detect whether we can set the sticky bit on our test
object. If we can't, then we avoid executing tests that
involve the sticky bit.
* tests/018/chmod.tl (test-sticky): New variable.
(cht): If test-sticky is false, only run the test if none of
the inputs contain a 't'.
|
|
|
|
|
|
| |
* tests/018/chmod.tl (mode-bits): Change body to correct
quasiquote.
(cht): Use previously unreferenced mode-bits macro.
|
|
|
|
|
|
|
|
|
|
| |
* RELNOTES: Updated.
* configure, txr.1: Bumped version and date.
* share/txr/stdlib/ver.tl: Likewise.
* txr.vim, tl.vim: Regenerated.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When @(skip :greedy) is used, there is an exception
complaining that :greedy isn't an integer.
Reported by a user "natrys" in the IRC channel.
This was introduced in July 2016, by commit
a208fafe0b0bf6dd5a78c939e55f0153f6bd6b19,
"Address silly uses of fixnump".
* match.c (h_skip, v_skip): Re-introduce the integer
check that was indadvertently removed.
|
|
|
|
|
|
| |
* ffi.c (ffi_varray_alloc): Add cast to this conversion. The
idea here is we are checking for truncation when cnum is
converted to size_t.
|
|
|
|
|
|
|
|
|
| |
This is Coreutils chmod behavior.
* sysif.c (chmod_wrap): Sample cmode into oldm at the start of
every assigment before punching the masked hole into cmode.
* tests/018/chmod.tl: Breaking test case added.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Within the same clause, permissions given by ugo must refer to
the unaltered permissions, before the target bits were masked
out, otherwise self-assignment like o=o just clears the
permissions. The other self-referential perm is X: it checks
for existing x permissions. That works with the current
value.
* sysif.c (chmod_wrap): Keep the old permissions in a new loop
variable called oldm. The u, g and o perms refer to oldm
rather than to the updated value in cmode. When we hit a
comma, we update oldm to the current value. The code for
this is now in one place with a goto.
* tests/018/chmod.tl: New test case that fails in the
absence of this fix. Test cases confirming that X
refers to the current permissions.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* sysif.c (chmod_wrap): The chm_comma state is transitioned to
after seeing a right hand side u, g or o. These do not combine
with other letters, so ch_comma expects a comma after which a
new permission clause we start,. Therefore the srcm and who
variables must be rest. It's also a good idea to continue the
loop.
* tests/018/chmod.tl: New test case which exposed
the above issue.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* sysif.c (chmod_wrap): Again, related to the = operator, we
must not punch a hole in the suid and sgid bits for all
non-directory objects. This was based on a misinterpretation
of some coreutils documentation, and doesn't match the
actual behavior. Rather, if the owner is a target (including
implicitly) then we mask out suid; and if the group owner is a
targe, then we mask out sgid. Thus when we are doing a
permission set not targetting the owner we don't touch suid,
and similarly for the group owner and setgid.
* tests/018/chmod.tl: Failed test diagnostics now
identify which mode string was used.
Some existing tests involving the suid/sgid bits
have to be revised because this commit reflects
a correction in the requirements. One new test is added.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* sysif.c (chmod_wrap): When processing set (=), only punch a
hole in the target permission area once per clause, so as not
to clobber previously set modes. We do this by checking for
the chm_perm state. Whenever '=' is processed, the state machine
enters into that state; when any permission letter is then
processed, it transitions out of that state. This gets the
"u=rwsx" test to pass.
* tests/018/chmod.tl: New tests.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The chmod fixes in the previous several commits were
caught by this.
* Makefile (tst/tests/018/chmod.ok): Set up TXR_ARGS for this
test to give it the location of the temporary file to use
as the object for testing permissions.
(tst/tests/018): Disable TXR_DBG_OPTS for new directory.
* tests/018/chmod.tl: New file.
* tests/018/chmod.expected: Likewise.
* tests/perm.tl: Likewise.
|
|
|
|
|
|
|
|
|
| |
* sysif.c (chmod_wrap): The umask logic is not activating
after the first iteration through the loop, because when who
is zero, we clobber it by adding the bits for u, g, and o.
Then on subsequent iterations, who is no longer zero.
Instead, let us leave the value of who alone, and in
all the relevant places, check for it being zero.
|
|
|
|
|
| |
* sysif.c (chmod_wrap): Clear the sticky bit from the right
variable: cmode rather than bits.
|
|
|
|
|
|
|
| |
* share/txr/stdlib/getput.tl (file-place-buf): Instead of "r+"
mode, use the new "mb" mode which will create the file without
truncating it, and open for write mode. Also, bugfix: the
"b" option was missing.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Quite surprisingly ISO C lacks a way in fopen to open a file
for writing such that it is not truncated if it already
exists, and not opened in append mode.
(But you will be glad to know that ISO C is adding incredibly
useful features in this area, like Microsoft's fopen_s!)
Let us add modes "m" and "m+" which will be like "w" and "w+",
but without the truncation to zero length (no O_TRUNC
is passed to open).
* stream.c (w_fopen_mode): New static function.
(open_file, open_tail, tail_strategy): Use w_fopen_mode
instead of directly calling w_fopen.
(do_parse_mode): Handle 'm' and set new notrunc flag.
* stream.h (struct stdio_mode): New member, notrunc flag.
(stdio_mode_init_blank, stdio_mode_init_r,
stdio_mode_init_rpb): Initializer macros updated to include
initializer for notrunc flag.
* txr.1: Documented "m" mode.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Like file-put-buf but doesn't overwrite the file.
* lisplib.c (getput_set_entries): New autoload for
file-place-buf.
* share/txr/stdlib/getput.tl (file-put-buf): New
argument for seeking into the file.
(file-place-buf): New function.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* buf.c (buf_grow): Function removed; logic merged into
buf_do_set_len. The bug fixed is that buf_grow was
initializing just the newly allocated bytes to init_val. The
bytes that must actually be initialized are those which lie
between the old and new length, not in the allocated area.
(make_buf): In make_buf, we don't have to initialize the
entire buffer, but only bytes 0 through len - 1. Now
calloc is only used when the initializing value is zero,
and the buffer's allocation size is the same as the length.
When the length is increase to protrude into the allocated
uninitialized area, buf_do_set_len will now properly
initialize that to the value given at that time.
* txr.1: Update make-buf documentation not to say that
all the bytes of the buffer are initialized.
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/getput.tl (sys:get-buf-common): Take two
more arguments for maximum bytes to read and offset.
Read loop simplified with fill-buf-adjust.
(file-get-buf, command-get-buf): Take two new arguments,
pass though to sys:get-buf-common.
* txr.1: Documented.
|
|
|
|
|
| |
* txr.1: It is wrongly documented that file-get-buf and
comman-get-buf use text streams; they use binary streams.
|
|
|
|
|
|
| |
* txr.1: The fill-buf function returns the position
after the last byte that was read, not the position of
that that last byte.
|
|
|
|
|
|
|
| |
* stream.c (stdio_fill_buf): In the case of EOF, we must not
return zero, but pos. Also, since pos and nread are cnum,
we should use num to convert their sum to val. Converting to
unum doesn't do anything for the overflow situation.
|
|
|
|
|
|
| |
* sysif.c (chmod_wrap): The uw_throw expression contains an
otal format specifier ~o which requires an integer argument;
but the mode can be a string now. Split into two cases.
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes the issue that TXR exits if an exception occurs
during Tab completion in the interactive listener.
This could happen when loading a file fails for whatever
reason, such as a corrupt or incomplete installation
of the library files or whatever.
* parser.c (provide_completions): Set up a catch all handler
here around everything, like we already did in provide_atom.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We can get rid of fstat_wrap entirely and make
the lstat and fstat function bindings point to the same
function.
* parser.c (load_rcfile): Call stat_wrap instead of
fstat_wrap.
* sysif.c (stat_wrap): Static function becomes extern. Useless
forward declaration removed.
(fstat_wrap): Static function removed.
(sysif_init): Bind fstat and lstat to the same function
object.
* sysif.h (fstat_wrap): Declaration removed.
(stat_wrap): Declaration added.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* sysif.c (get_fd): Move this function higher in the file to
avoid forward declarations. The do_fstatt code being moved into
do_stat needs to call it.
(do_stat): Provide stat and fstat functionality in one
function.
(do_fstat): Static function removed.
(fstat_wrap): Call do_stat instead of do_fstat.
* txr.1: Updated.
|
|
|
|
|
|
| |
* txr.1: the Stream Output Limitation section is about the
mechanism to limit output, not about limits of capability;
the word we want is "Limiting".
|
|
|
|
|
| |
* txr.1: Fix reference to a nonexistent stream-fd function;
the correct name is fileno.
|
|
|
|
|
|
|
|
|
|
|
|
| |
The chmod function can now take a string, which uses the same
conventions as the symbolic mode argument of the chmod utility.
* sysif.c (CHM_O, CHM_G, CHM_U): New preprocessor symbols.
(enum chm_state, enum chm_op): New enums.
(chmod_wrap): Allow argument to be a string, and in that case
interpret the chmod symbolic permission language.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (copy_file_set_entries): Add chown-rec and
chmod-rec to list of symbols that trigger auto-load of
copy-file.tl.
* share/txr/stdlib/copy-file.tl (chmod-rec, chown-rec): Neew
functions.
* txr.1: Documented.
|
|
|
|
|
| |
* txr.1: The catch section fails to mention the catch**
operator in the section heading.
|
|
|
|
| |
* txr.1: fix repeated word.
|
|
|
|
|
|
|
|
| |
* txr.1: Fix wrong documentation about defex. It does allow
registration of duplicate relationhips and updates that
do not create cycles. Document a rule that is missing: that
a subtype relationships can't be registered when the opposite
relationship already exists.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On 2009-10-02, prior to TXR 014, I made a change to the c_str
function to allow symbolic arguments, so that c_str(sym) could
be used in the code base instead of c_str(symbol_name(sym)).
This was a bad idea, and is allowing numerous functions that
operate on strings to accept symbols also. That behavior is
not documented and not consistently supported. Ironically, I
completely forgot about this and have been consistently using
symbol_name(sym) anyway. Let us remove this.
Compat support is required because this will break user code
that accidentally depends on this undocumented behavior.
* lib.c (c_str): If the object is type SYM, only return the
symbol_name if compatibility with 231 or older is requested,
otherwise fall through to the error case.
* match.c (dump_var): Fix one case where a symbol is passed
directly to put_string. This fails one of the test cases.
More testing is required to see if any other such cases occur.
* txr.1: New entry in the compatibility notes.
|
|
|
|
|
|
|
|
|
|
|
|
| |
The open-files and open-files* functions are missing a mode
string argument, which makes it impossible to, say, open all
of the files in "rb" mode on a platform where that matters.
* stream.c (open_files, open_files_star): Take mode as a third
optional parameter. If it is present, then pass it to
open_file.
* txr.1: Document mode string parameter for the two functions.
|
|
|
|
| |
* txr.1: Under rename-path, remove-path is wrongly referenced.
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/copy-file.tl (copy-file): Detect that
from-path is a directory before attempting to open it. The
issue is that the open will succeed for a directory, and only
the subsequent read will fail. By that time we have opened
created the target file.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* lisplib.c (copy_file_instantiate, copy_file_set_entries):
New static functions.
(lisplib_init): Register auto-load of copy-file.tl via
new functions.
* share/txr/stdlib/copy-file.tl: New file.
* txr.1: New section Unix Filesystem Complex Operations.
Here copy-file, copy-files, copy-path-rec and remove-path-rec
are documented.
|
|
|
|
|
|
|
| |
* unwind.c (uw_late_init): Register retry and skip symbols
as exception subtypes of restart.
* txr.1: Document retry and skip restarts.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The configure command line is now turned into an
executable script called reconfigure which can be invoked to
repeat the config.
* Makefile (distclean): Whether in a configured or state or
not, try to remove reconfigure. In the configured state, don't
remove config.log. (If distclean is invoked when not
configured, the config.* pattern will remove config.log).
* configure: rewrite the logic which turns the command line
into text. It is now robust against spaces, quotes and
meta-charaters. Moreover, the printed representation is chosen
according to good heuristics to minimize unnecessary quoting
and escaping. The config line is written into an executable
script called reconfigure. This is now done twice; it is done
immediately, so that we save the command line even if the
configure subsequently fails. A comment is added to
reconfigure indicating that configure didn't succeed. Then
after a successful run through the tests, we save it again,
without the cautionary comment. Help texts updated.
|
|
|
|
|
|
|
| |
* eval.c (eval_init): bugfix: for the functions
package-symbols, package-local-symbols and
package-foreign-symbols, make the package parameter optional,
as is specified in the documentation.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a useful function which supports the use of temporary
packages over the scope of file compilation units.
A file can be read under a temporary package which provides
usefully customized symbol visibility consisting of
an arrangement of symbols from various other packages.
Then, in a single operation, thanks to this new function,
that packag can be deleted and all of its local symbols
(those having been newly interned over the course of the
file) are transferred to some other, more permanent package.
* eval.c (eval_init): merge-delete-package intrinsic
registered.
* lib.c (merge_delete_package): New function.
* lib.h (merge_delete_package): Declared.
* txr.1: Documented.
|
|
|
|
|
|
|
|
|
|
|
|
| |
* share/txr/stdlib/compiler.tl (compiler comp-catch): Compile
the try expression and the description in the newly extended
environment rather than the original environment. This is
necessary because the compiled code for both of these is
is placed into the frame level corresponding to the new
environment. Other than the level, the only difference between
the two environment is that nenv has a couple of gensyms.
Thus it is hygienic w.r.t. the try and desc code; the extended
environment can safely be used.
|
|
|
|
|
|
| |
* vm.c (do_frame): In frame level mismatch diagnostic,
identify vm descriptor, instruction offset and the expected
and actual level.
|