From 6e729faf8a1a588a58f6f75281545e6710dfd603 Mon Sep 17 00:00:00 2001 From: "Alexander S. Aganichev" Date: Wed, 30 Oct 2002 16:18:24 +0000 Subject: [PATCH] MC clipboard support - 2 --- docs/notework.txt | 2 ++ goldlib/gall/gutlunix.cpp | 14 ++++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/docs/notework.txt b/docs/notework.txt index 9181af1..b8aa4a9 100644 --- a/docs/notework.txt +++ b/docs/notework.txt @@ -12,6 +12,8 @@ ______________________________________________________________________ Notes for GoldED+ 1.1.5, /snapshot/ ______________________________________________________________________ +- Another try to support MC clipboard. + - Once again Numlock was not taken into account for Del in Win9x (not tested). diff --git a/goldlib/gall/gutlunix.cpp b/goldlib/gall/gutlunix.cpp index 5ffe96a..f58a229 100644 --- a/goldlib/gall/gutlunix.cpp +++ b/goldlib/gall/gutlunix.cpp @@ -92,7 +92,9 @@ void g_set_osicon(void) { bool g_is_clip_available(void) { - return is_dir(CLIPDIR); + std::string clipdir = CLIPDIR; + strschg_environ(clipdir); + return is_dir(clipdir); } @@ -100,11 +102,13 @@ bool g_is_clip_available(void) { char* g_get_clip_text(void) { - size_t size = GetFilesize(CLIPFILE); + std::string clipfile = CLIPFILE; + strschg_environ(clipfile); + size_t size = GetFilesize(clipfile.c_str()); char *text = (char *)throw_malloc(size+1); *text = NUL; - FILE *f = fopen(CLIPFILE, "rt"); + FILE *f = fopen(clipfile.c_str(), "rt"); if(f != NULL) { fread(text, 1, size, f); text[size] = NUL; @@ -119,7 +123,9 @@ char* g_get_clip_text(void) { int g_put_clip_text(const char* buf) { - FILE *f = fopen(CLIPFILE, "wt"); + std::string clipfile = CLIPFILE; + strschg_environ(clipfile); + FILE *f = fopen(clipfile.c_str(), "wt"); if(f != NULL) { fwrite(buf, 1, strlen(buf), f); fclose(f);