Translate and escape chars in info tag strings

Fixes LP: #1716998
This commit is contained in:
Andrew Johnson
2018-02-24 19:11:54 -06:00
parent ae548d3400
commit e41f8bf518
2 changed files with 9 additions and 4 deletions
+1
View File
@@ -1069,6 +1069,7 @@ static void dbRecordInfo(char *name, char *value)
if(duplicate) return;
ptempListNode = (tempListNode *)ellFirst(&tempList);
pdbentry = ptempListNode->item;
dbTranslateEscape(value, value); /* yuck: in-place, but safe */
status = dbPutInfo(pdbentry,name,value);
if(status) {
epicsPrintf("Can't set \"%s\" info \"%s\" to \"%s\"\n",
+8 -4
View File
@@ -851,10 +851,14 @@ long dbWriteRecordFP(
status=dbNextField(pdbentry,dctonly);
}
status = dbFirstInfo(pdbentry);
while(!status) {
fprintf(fp,"\tinfo(\"%s\",\"%s\")\n",
dbGetInfoName(pdbentry), dbGetInfoString(pdbentry));
status=dbNextInfo(pdbentry);
while (!status) {
const char *pinfostr = dbGetInfoString(pdbentry);
fprintf(fp, "\tinfo(\"%s\",\"",
dbGetInfoName(pdbentry));
epicsStrPrintEscaped(fp, pinfostr, strlen(pinfostr));
fprintf(fp, "\")\n");
status = dbNextInfo(pdbentry);
}
fprintf(fp,"}\n");
status = dbNextRecord(pdbentry);