Add a "tclesc[ape]" variant of hlistprop / tcl{,list,esc,escape}

And use it in gumxml.tcl
This commit is contained in:
Douglas Clowes
2014-07-01 11:22:42 +10:00
parent 4f397350cb
commit 132af9d225
2 changed files with 7 additions and 4 deletions

View File

@@ -3593,7 +3593,10 @@ static int ListSICSHdbProperty(SConnection * pCon, SicsInterp * pSics,
SCWrite(pCon, "ERROR: need path as parameter", eError);
return 0;
} else if (argc == 3) {
genTclList = 1;
if (strncasecmp(argv[2], "tcl", 3) == 0)
genTclList = 1;
if (strncasecmp(argv[2], "tclesc", 6) == 0)
genTclList |= 2;
}
targetNode = FindHdbNode(NULL, argv[1], pCon);
if (targetNode == NULL) {
@@ -3613,7 +3616,7 @@ static int ListSICSHdbProperty(SConnection * pCon, SicsInterp * pSics,
DynStringConcatChar(data, ' ');
DynStringConcatChar(data, '{');
for (bp = buffer; *bp; ++bp) {
if (*bp == '{' || *bp == '}')
if (genTclList & 2 && (*bp == '{' || *bp == '}'))
DynStringConcatChar(data, '\\');
DynStringConcatChar(data, *bp);
}