|
From: Hans-Bernhard B. <br...@ph...> - 2005-11-14 08:45:17
|
Ethan A Merritt wrote:
> It *would* be ended by the trailing single quote, if there were one.
> But there is no such trailing single quote in your command line
> because the only candidate has been escaped by a backslash.
No, it's not supposed to be escaped. At least not in any version up to
4.0 it wasn't. There are no backslash escapes being processed on
single-quoted strings in gnuplot, period. See 'help syntax'. Thus this
behaviour:
> gnuplot> set title 'C:\'; foo' ; show title
> title is "C:\\'; foo", offset at ((character units) 0, 0, 0)
Is a bug, and has been as long as it was present in the program.
> The backslash character is always interpreted as an escape during input.
Not inside single-quoted strings.
> Single or double quotes make no difference.
If so, that's a bug, or an incompatible change since version 4.0. Proof
from 4.0 on Win32:
gnuplot> set label 1 "a\n\t\\\qb"
gnuplot> set label 2 'a\n\t\\\qb'
gnuplot> show lab
label 1 "a\n\t\\qb" at (0, 0, 0) left not rotated back nopoint
label 2 "a\\n\\t\\\\\\qb" at (0, 0, 0) left not rotated back nopoint
gnuplot>
In other words: \-escape sequences in "" can become special characters
like LF, TAB or the backslash itself, whereas \ characters in '' become
literal \ characters, which 'show' doubles up since it uses "" strings.
|