History log of /netbsd-src/lib/libedit/filecomplete.c (Results 1 – 25 of 73)
Revision Date Author Comments
# 4ee54736 25-Apr-2023 christos <christos@NetBSD.org>

pass lint.


# 3ce4aa66 03-Feb-2023 christos <christos@NetBSD.org>

Add a entry point for the complete function for FreeBSD compatibility with sh.


# 21a4b1cc 30-Oct-2022 christos <christos@NetBSD.org>

improvements in malloc/free handling.


# d1647d9c 12-Mar-2022 christos <christos@NetBSD.org>

Fix filename autocompletion for strings like a\)b

An escaped character should unconditionally be skipped together with the
character that does the escaping. For example, in "a\)b" only the ")b"
part

Fix filename autocompletion for strings like a\)b

An escaped character should unconditionally be skipped together with the
character that does the escaping. For example, in "a\)b" only the ")b"
part was skipped but then the loop stopped at the "\" since it's one of
the characters listed in word_break. (Piotr P. Stefaniak)

show more ...


# 5679adf8 26-Sep-2021 christos <christos@NetBSD.org>

- Completion should not add a quote at the end of the line to match an
already quoted quote. (Piotr Stefaniak)
- fix lint unconst warnings for strchr


# 20fa0b90 05-May-2021 christos <christos@NetBSD.org>

PR/56147: Miroslav Lichvar: Avoid memory leak if strdup fails.


# ba06fc1c 28-Mar-2021 christos <christos@NetBSD.org>

Only unescape when we are quoting and don't add a space if we are quoting
(we already did) (Piotr Stefaniak)


# b9455193 28-Mar-2021 christos <christos@NetBSD.org>

Pass the unescaped filename the the append function so it has to do less work
(for example it can call stat(2) directly (Piotr Stefaniak)


# 65371df8 27-Mar-2021 christos <christos@NetBSD.org>

Add fn_complete2() that controls the quoting of the returned match.
Before it was based on the heuristic that we were not supplied an
attempted_completion_function, which worked well because programs

Add fn_complete2() that controls the quoting of the returned match.
Before it was based on the heuristic that we were not supplied an
attempted_completion_function, which worked well because programs
that supplied that function were not shells and did not want/understand
shell quoting. Recently though Piotr Stefaniak wanted to enhance command
completion for the Bourne Shell and this could benefit quoting the returned
command. This function adds an extra flags argument that controls that quoting.

show more ...


# 2d114b3c 05-Jan-2020 abhinav <abhinav@NetBSD.org>

PR lib/54510 - when user supplied completion function is there,
don't unescape the string to be completed.


# 52de8937 05-Jan-2020 tih <tih@NetBSD.org>

Summary: Remove over-simplified extraneous test

The file name matching code in libedit tries to adjust to the presence
of explicit " or ' characters in the input line, but tries too hard.
Remove a c

Summary: Remove over-simplified extraneous test

The file name matching code in libedit tries to adjust to the presence
of explicit " or ' characters in the input line, but tries too hard.
Remove a conditional that goes overboard, and causes the completion
code to fail if a quoted string is seen before the filename to be
expanded, as in

grep 'foo' bar<TAB>

Before this change, the above would not expand any possible
completions, even if they existed, because it would choose to look for
files whose names started with " bar".

show more ...


# 5e9cbb11 10-Dec-2019 christos <christos@NetBSD.org>

When 'attempted_completion_function' non-NULL, with a 'single_match'
match, the expected space is not being added. Problem observed with
"chronyc" and "sqlite3" tab completion. That functionality got

When 'attempted_completion_function' non-NULL, with a 'single_match'
match, the expected space is not being added. Problem observed with
"chronyc" and "sqlite3" tab completion. That functionality got
moved to escape_filename() for the !attempted_completion_function
case, but the non-NULL 'attempted_completion_function' case must
also be handled. (Lonnie Abelbeck)

show more ...


# a47ebb18 09-Oct-2019 christos <christos@NetBSD.org>

add +1 to strlcpy's (Patrick Welche)


# 3df2b626 08-Oct-2019 christos <christos@NetBSD.org>

remore error(1) comment


# 991f6216 08-Oct-2019 christos <christos@NetBSD.org>

Change strncpy to either memcpy (when we know the len), or strlcpy (when
we used to NUL terminate explicitly.


# c3d00a7d 08-Sep-2019 abhinav <abhinav@NetBSD.org>

PR lib/54510: Fix file completion inside quotes which broke in rev 1.53

While there also fix handling character appending in the file completions when
inside quotes. For example when inside a quote,

PR lib/54510: Fix file completion inside quotes which broke in rev 1.53

While there also fix handling character appending in the file completions when
inside quotes. For example when inside a quote, if the completion is a directory then
append a '/' but don't close the quote. On the other hand when inside a quote if the
completion is a file name and it is the only match then we can close the quote.

show more ...


# 272963ae 28-Jul-2019 christos <christos@NetBSD.org>

PR/54415: Ricky Zhou: libedit stats completions for non-file completions
Use the proper completion function and account for the character appended
by the function when computing the number of columns.


# 113f06a3 23-Jul-2019 christos <christos@NetBSD.org>

PR/54399: Sören Tempel: Uninitialized memory access in libedit history.
Initialize the buffer using calloc. While here change all malloc(a * sizeof(b))
to calloc(a, sizeof(b)). XXX: should fix reallo

PR/54399: Sören Tempel: Uninitialized memory access in libedit history.
Initialize the buffer using calloc. While here change all malloc(a * sizeof(b))
to calloc(a, sizeof(b)). XXX: should fix realloc similarly.

show more ...


# 63147cb5 20-Apr-2019 abhinav <abhinav@NetBSD.org>

PR lib/54131 - declare the loop variable outside the for loop


# 7512edc2 12-Apr-2019 christos <christos@NetBSD.org>

PR/54117: Paavo Helde: Fix memory overrun: Account for the closing quote
in memory allocation if quoted.


# c93cba3a 31-Mar-2019 abhinav <abhinav@NetBSD.org>

Perform quoting of filename completions when there are multiple matches as well

Quoting of special characters in filename completion was implemented for single match
case, this enables it for multip

Perform quoting of filename completions when there are multiple matches as well

Quoting of special characters in filename completion was implemented for single match
case, this enables it for multiple matches as well. For example:

$ touch 'foo bar'
$ touch 'foo baz'
$ ls fo<TAB>
autocompletes to =>
$ ls foo\ ba
hitting <TAB> again shows:
foo bar foo baz

This required unescaping escape sequences generated during last completion
in order to find the word to complete.

While there, also update the test to include cases for multiple matches.

Reviewed by christos

show more ...


# e09538bd 24-Mar-2019 abhinav <abhinav@NetBSD.org>

Only quote the completion matches if we are doing filename completion

If the user supplies a value for the attempted_completion_function parameter
then we cannot be sure if the completion is for fil

Only quote the completion matches if we are doing filename completion

If the user supplies a value for the attempted_completion_function parameter
then we cannot be sure if the completion is for filename or something else, in such
a case don't attempt to quote the completion matches.

Reviewed by christos

This should address PR lib/54067

show more ...


# 01f10711 04-May-2018 christos <christos@NetBSD.org>

fix uninitialized


# 2afc179c 04-May-2018 abhinav <abhinav@NetBSD.org>

Handle filename autocompletion when the cursor is at a backslash or quote character

For example, handle following case:
$ touch 'foo bar'
$ ls foo\<TAB> --> $ ls foo\ bar

Also add test cases for

Handle filename autocompletion when the cursor is at a backslash or quote character

For example, handle following case:
$ touch 'foo bar'
$ ls foo\<TAB> --> $ ls foo\ bar

Also add test cases for this.

Thanks to Christos for review

show more ...


# b36e4c8f 02-May-2018 abhinav <abhinav@NetBSD.org>

Add '*' and '[' to the list of characters which need escaping during autocompletion


123