search for: decode_ps1

Displaying 10 results from an estimated 10 matches for "decode_ps1".

2015 Jan 21
1
Re: [PATCH] fish: remove extra "prompt" checks
...ed, 2 insertions(+), 2 deletions(-) > > diff --git a/fish/fish.c b/fish/fish.c > index 8b74c7b..71db83a 100644 > --- a/fish/fish.c > +++ b/fish/fish.c > @@ -661,8 +661,8 @@ rl_gets (int prompt) > line_read = NULL; > } > > - p = prompt && ps1 ? decode_ps1 (ps1) : NULL; > - line_read = readline (prompt ? (ps1 ? p : FISH) : ""); > + p = ps1 ? decode_ps1 (ps1) : NULL; > + line_read = readline (ps1 ? p : FISH); Can be simplified further: line_read = readline (ps1 ? decode_ps1 (ps1) : FISH); Regards, Hu > > if...
2015 Jan 20
9
[PATCH] daemon: readdir: fix invalid memory access on error
If "strdup (d->d_name)" fails with "i" > 0, then both "p" and "ret->guestfs_int_dirent_list_val" are non-null pointers, but the latter is no more valid (since "p" is the new realloc'ed buffer). Hence, trying to free both will access to invalid memory. Make sure to free only one of them, "p" if not null or
2015 Jan 20
0
[PATCH] fish: remove extra "prompt" checks
...redundant. --- fish/fish.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fish/fish.c b/fish/fish.c index 8b74c7b..71db83a 100644 --- a/fish/fish.c +++ b/fish/fish.c @@ -661,8 +661,8 @@ rl_gets (int prompt) line_read = NULL; } - p = prompt && ps1 ? decode_ps1 (ps1) : NULL; - line_read = readline (prompt ? (ps1 ? p : FISH) : ""); + p = ps1 ? decode_ps1 (ps1) : NULL; + line_read = readline (ps1 ? p : FISH); if (ps_output) { /* GUESTFISH_OUTPUT */ CLEANUP_FREE char *po = decode_ps1 (ps_output); -- 1.9.3
2016 Feb 16
2
[PATCH] fish: reset the console on ^Z RHBZ#1213844
Patch registers SIGTSTP hook where it sends reset terminal color control sequence. Maros Zatko (1): fish: reset the console on ^Z RHBZ#1213844 fish/fish.c | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) -- 2.5.0
2016 Feb 16
0
[PATCH] fish: reset the console on ^Z RHBZ#1213844
...ence. --- fish/fish.c | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/fish/fish.c b/fish/fish.c index d26f8b3..b579898 100644 --- a/fish/fish.c +++ b/fish/fish.c @@ -73,6 +73,11 @@ static void cleanup_readline (void); static char *decode_ps1 (const char *); static void add_history_line (const char *); #endif +static void set_stophandler (void); +static void restore_stophandler (void); +static void user_control_z (int sig); + +static void (*otstpfn) = SIG_DFL; static int override_progress_bars = -1; static struct progress_bar *bar...
2014 Dec 04
1
[PATCH] fish: fix build warning when readline-devel is missing
...char *ps_restore = NULL; /* GUESTFISH_RESTORE */ static char *line_read = NULL; static char * @@ -698,10 +700,12 @@ script (int prompt) struct parsed_command pcmd; if (prompt) { +#ifdef HAVE_LIBREADLINE if (ps_init) { /* GUESTFISH_INIT */ CLEANUP_FREE char *pi = decode_ps1 (ps_init); printf ("%s", pi); } +#endif /* HAVE_LIBREADLINE */ printf (_("\n" "Welcome to guestfish, the guest filesystem shell for\n" @@ -739,6 +743,7 @@ script (int prompt) } } +#ifdef HAVE_LIBREADLINE if (prompt) {...
2016 Mar 08
1
[PATCH] fish: reset the console on ^Z RHBZ#1213844
Patch registers SIGTSTP hook where it sends reset terminal color control sequence using write and fsync. Handler is installed only if signal is not being ignored. Patch uses rl_free_line_state and rl_cleanup_after_signal to unhook readline from terminal, then it calls original TSTP handler using approach in URL below and again hooks readline using rl_reset_after_signal. Handling is based on code
2014 May 29
2
Re: libguestfs error
Hi Rich I using ubuntu 13.10 with powerpc arch. I tried the above stepss and below are the output of the related commands.. nm -D /usr/lib/powerpc-linux-gnu/libtinfo.so | grep tgetent 0000def0 T tgetent ubuntu@t4240-ubuntu1310:~$ dpkg -S /usr/lib/powerpc-linux-gnu/libtinfo.so libtinfo-dev:powerpc: /usr/lib/powerpc-linux-gnu/libtinfo.so However I'm not able to perform rm -f config.cache
2014 May 29
2
Re: libguestfs error
...CC guestfish-fish.o fish.c: In function 'main': fish.c:173:3: warning: implicit declaration of function 'time' [-Wimplicit-function-declaration] srandom (time (NULL)); ^ fish.c: In function 'script': fish.c:699:7: warning: implicit declaration of function 'decode_ps1' [-Wimplicit-function-declaration] CLEANUP_FREE char *pi = decode_ps1 (ps_init); ^ fish.c:699:31: warning: initialization makes pointer from integer without a cast [enabled by default] CLEANUP_FREE char *pi = decode_ps1 (ps_init); ^ fish.c:742...
2016 Apr 04
2
[PATCH 1/2] Use 'error' function consistently throughout.
...("GUESTFISH_INIT"); if (str) { free (ps_init); ps_init = strdup (str); - if (!ps_init) { - perror ("strdup"); - exit (EXIT_FAILURE); - } + if (!ps_init) + error (EXIT_FAILURE, errno, "strdup"); } #endif } @@ -1557,10 +1536,8 @@ decode_ps1 (const char *str) * future. */ ret = malloc (len + 1); - if (!ret) { - perror ("malloc"); - exit (EXIT_FAILURE); - } + if (!ret) + error (EXIT_FAILURE, errno, "malloc"); for (i = j = 0; i < len; ++i) { if (str[i] == '\\') { /* St...