74f14793f6f8d1e03f542f6dcf38704cdaa88c53 larrym Sun Apr 1 23:27:42 2012 -0700 use double quotes in jsonHashAddString to conform to JSON standard diff --git src/hg/lib/jsHelper.c src/hg/lib/jsHelper.c index 8860f5b..5720a2e 100644 --- src/hg/lib/jsHelper.c +++ src/hg/lib/jsHelper.c @@ -502,31 +502,31 @@ if (h == NULL) // If hash isn't provided, assume global { if (jsonGlobalsHash == NULL) jsonGlobalsHash = newJsonHash(newHash(8)); h = jsonGlobalsHash; } hashReplace(h->hash, name, ele); } void jsonHashAddString(struct jsonHashElement *h, char *name, char *val) { // Add a string to a hash which will be used to print a javascript object; // existing values are replaced. val = javaScriptLiteralEncode(val); char *str = needMem(strlen(val) + 3); -sprintf(str, "'%s'", val); +sprintf(str, "\"%s\"", val); freez(&val); jsonHashAdd(h, name, (struct jsonElement *) newJsonString(str)); } void jsonHashAddNumber(struct jsonHashElement *h, char *name, long val) { // Add a number to a hash which will be used to print a javascript object; // existing values are replaced. char buf[256]; safef(buf, sizeof(buf), "%ld", val); jsonHashAdd(h, name, (struct jsonElement *) newJsonString(buf)); } void jsonHashAddDouble(struct jsonHashElement *h, char *name, double val) {