On 03/07/2017 11:46 PM, yary wrote:
No, my main intent is showng that the code won't copy a string with a
quote in it, and can have unintended side effects.

I was thinking you were concerned over security,

This guy's workaround is

https://github.com/kmwallio/p6-OS-Clipboard/blob/master/lib/OS/Clipboard.pm6

<code>
  sub clipboard-slash($text) {
    my $str = $text;
    $str ~~ s:g/\\/\\\\/;
    $str ~~ s:g/\"/\\"/;
    return $str;
  }

  sub clipboard-deslash($text) {
    my $str = $text;
    $str ~~ s:g/\\\"/\"/;
    return $str;
  }
</code>


Hmmmm.  Maybe I should too.

>  I mostly run on Windows!

:-)

I am on site service and consulting for small businesses.
90% of my income comes for Windows' poor quality.  If
business ever switch to Linux, I am out of work.  I
support Windows, Linux, Mac.  I hardly ever see a Mac,
but, it slowly comes back when I do and I conquer.
(To me Mac is just weird for the sake of being weird,
but it is a living!  A computer is a computer is a
computer.)

-T


--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Computers are like air conditioners.
They malfunction when you open windows
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Reply via email to