4898794edd81be5285ea6e544acbedeaeb31bf78 max Tue Nov 23 08:10:57 2021 -0800 Fixing pointers to README file for license in all source code files. refs #27614 diff --git src/lib/xmlEscape.c src/lib/xmlEscape.c index 6912d5a..dc1836d 100644 --- src/lib/xmlEscape.c +++ src/lib/xmlEscape.c @@ -1,82 +1,82 @@ /* Handle escaping for XML files. Deal with things like * & and ". */ /* Copyright (C) 2011 The Regents of the University of California - * See README in this or parent directory for licensing information. */ + * See kent/LICENSE or http://genome.ucsc.edu/license/ for licensing information. */ #include "common.h" #include "hash.h" #include "xmlEscape.h" struct hash *xmlEscapeSymHash() /* Return hash of predefined xml character symbols to lookup. */ { struct hash *symHash = newHash(6); hashAdd(symHash, "lt", "<"); hashAdd(symHash, "gt", ">"); hashAdd(symHash, "amp", "&"); hashAdd(symHash, "apos", "'"); hashAdd(symHash, "quot", "\""); return symHash; } void xmlEscapeBytesToFile(unsigned char *buffer, int len, FILE *f) /* Write buffer of given length to file, escaping as need be. */ { unsigned char c; int i; for (i=0; i<len; ++i) { c = buffer[i]; if (isalnum(c)) fputc(c, f); else { switch (c) { case '&': fputs("&", f); break; case '\'': fputs("'", f); break; case '"': fputs(""", f); break; case '<': fputs("<", f); break; case '>': fputs(">", f); break; case ' ': case '-': case '\t': case '\n': case ',': case '.': case ';': case ':': case '(': case ')': case '[': case ']': case '#': case '/': fputc(c, f); break; default: fprintf(f, "&#%d;", c); break; } } } } void xmlEscapeStringToFile(char *s, FILE *f) /* Write escaped zero-terminated string to file. */ { int len = strlen(s); xmlEscapeBytesToFile((unsigned char *)s, len, f); }