mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 05:13:10 +00:00
Modified kill.cpp to use env_get_string().
This commit is contained in:
parent
943cc68f54
commit
15296dedd5
1 changed files with 10 additions and 7 deletions
17
kill.cpp
17
kill.cpp
|
@ -104,11 +104,13 @@ void kill_add( wchar_t *str )
|
||||||
I couldn't think of a safe way to allow overide of the echo
|
I couldn't think of a safe way to allow overide of the echo
|
||||||
command too, so, the command used must accept the input via stdin.
|
command too, so, the command used must accept the input via stdin.
|
||||||
*/
|
*/
|
||||||
wchar_t *clipboard;
|
|
||||||
if( (clipboard = env_get(L"FISH_CLIPBOARD_CMD")) )
|
const wcstring clipboard_wstr = env_get_string(L"FISH_CLIPBOARD_CMD");
|
||||||
|
// const wchar_t *clipboard = clipboard_wstr.empty()?NULL:clipboard.c_str();
|
||||||
|
if( !clipboard_wstr.empty() )
|
||||||
{
|
{
|
||||||
escaped_str = escape( str, 1 );
|
escaped_str = escape( str, 1 );
|
||||||
cmd = wcsdupcat(L"echo -n ", escaped_str, clipboard);
|
cmd = wcsdupcat(L"echo -n ", escaped_str, clipboard_wstr.c_str());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -117,8 +119,9 @@ void kill_add( wchar_t *str )
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
wchar_t *disp;
|
const wcstring disp_wstr = env_get_string( L"DISPLAY" );
|
||||||
if( (disp = env_get( L"DISPLAY" )) )
|
// wchar_t *disp = disp_wstr.empty()?NULL:disp_wstr.c_str();
|
||||||
|
if( !disp_wstr.empty() )
|
||||||
{
|
{
|
||||||
escaped_str = escape( str, 1 );
|
escaped_str = escape( str, 1 );
|
||||||
cmd = wcsdupcat(L"echo ", escaped_str, L"|xsel -b" );
|
cmd = wcsdupcat(L"echo ", escaped_str, L"|xsel -b" );
|
||||||
|
@ -215,13 +218,13 @@ wchar_t *kill_yank_rotate()
|
||||||
*/
|
*/
|
||||||
static void kill_check_x_buffer()
|
static void kill_check_x_buffer()
|
||||||
{
|
{
|
||||||
wchar_t *disp;
|
wcstring disp;
|
||||||
|
|
||||||
if( !has_xsel() )
|
if( !has_xsel() )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
||||||
if( (disp = env_get( L"DISPLAY" )) )
|
if( (!(disp = env_get_string( L"DISPLAY" )).empty()) )
|
||||||
{
|
{
|
||||||
size_t i;
|
size_t i;
|
||||||
wcstring cmd = L"xsel -t 500 -b";
|
wcstring cmd = L"xsel -t 500 -b";
|
||||||
|
|
Loading…
Reference in a new issue