Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
lsh
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LSH
lsh
Commits
e75f7052
Commit
e75f7052
authored
Mar 23, 2002
by
Pontus Freyhult
Browse files
Options
Downloads
Patches
Plain Diff
Use WITH_READLINE and WITH_HISTORY instead of awful checks for
FOO_HISTORY_H and so on. Rev: src/sftp/rl.c:1.3
parent
556d9172
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/sftp/rl.c
+36
-26
36 additions, 26 deletions
src/sftp/rl.c
with
36 additions
and
26 deletions
src/sftp/rl.c
+
36
−
26
View file @
e75f7052
...
...
@@ -32,7 +32,7 @@ int sloppy_complete = 2;
#include
"rl.h"
#ifdef
HAVE
_READLINE
_READLINE_H
#ifdef
WITH
_READLINE
#include
"str_utils.h"
static
int
lsftp_rl_line_inited
=
0
;
...
...
@@ -68,11 +68,17 @@ static int lsftp_rl_line_inited=0;
# endif
/* HAVE_CHAR_IS_QUOTED */
#endif
/* HAVE_RL_CHAR_IS_QUOTED */
/* FIXME: review readline support, proper way to do it? */
void
lsftp_rl_init
()
{
/* Basic readline initialization goes here */
# ifdef
HAVE_READLINE
_HISTORY
_H
# ifdef
WITH
_HISTORY
char
*
histfname
=
lsftp_rl_history_fname
();
...
...
@@ -84,7 +90,7 @@ void lsftp_rl_init()
free
(
histfname
);
}
# endif
/*
HAVE_READLINE
_HISTORY
_H
*/
# endif
/*
WITH
_HISTORY */
/* Allow conditional parsing of the ~/.inputrc file. */
rl_readline_name
=
"lsftp"
;
...
...
@@ -104,7 +110,7 @@ void lsftp_rl_exit()
/* Called to finish business with readline, only saves history and
* makes sure we don't have no callback handler */
# ifdef
HAVE_READLINE
_HISTORY
_H
# ifdef
WITH
_HISTORY
char
*
histfname
=
lsftp_rl_history_fname
();
using_history
();
/* Use history function */
...
...
@@ -115,7 +121,7 @@ void lsftp_rl_exit()
free
(
histfname
);
}
# endif
# endif
/* WITH_HISTORY */
rl_callback_handler_remove
();
}
...
...
@@ -175,6 +181,10 @@ int char_quoted( char* text, int index )
return
normalq
||
nextliteral
||
literalq
;
}
char
**
lsftp_rl_completion
(
char
*
text
,
int
start
,
int
end
)
{
char
**
matches
=
NULL
;
...
...
@@ -456,7 +466,7 @@ void lsftp_rl_lhandler(char* line)
lsftp_rl_line_inited
=
0
;
lsftp_rl_line
=
line
;
# ifdef
HAVE_READLINE
_HISTORY
_H
# ifdef
WITH
_HISTORY
if
(
line
&&
*
line
)
/* Got a line and it's not empty? */
add_history
(
line
);
/* Save to history */
# endif
...
...
@@ -492,7 +502,7 @@ char* lsftp_rl_history_fname()
}
#else
/* ifdef
HAVE
_READLINE
_READLINE_H
*/
#else
/* ifdef
WITH
_READLINE */
/* Readline not found */
...
...
@@ -539,5 +549,5 @@ lsftp_rl_history_fname(void)
return
0
;
}
#endif
/* ifdef
HAVE
_READLINE
_READLINE_H
*/
#endif
/* ifdef
WITH
_READLINE */
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment