]> granicus.if.org Git - postgresql/commitdiff
Escape newline in select output, from A. Duursma.
authorBruce Momjian <bruce@momjian.us>
Sun, 1 Jun 1997 03:18:32 +0000 (03:18 +0000)
committerBruce Momjian <bruce@momjian.us>
Sun, 1 Jun 1997 03:18:32 +0000 (03:18 +0000)
src/interfaces/libpq/fe-exec.c

index 65197c2fe4f94f07f68d4948535b1c8603a3da7b..357ef3b832b1e621eea79dd807db9234256d02b8 100644 (file)
@@ -7,7 +7,7 @@
  *
  *
  * IDENTIFICATION
- *    $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.29 1997/05/20 03:39:02 momjian Exp $
+ *    $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-exec.c,v 1.30 1997/06/01 03:18:32 momjian Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -919,7 +919,7 @@ do_field(PQprintOpt *po, PGresult *res,
 
     if (!skipit) {
         for (p=pval, o=buf; *p; *(o++)=*(p++)) {
-            if ((fs_len==1 && (*p==*(po->fieldSep))) || *p=='\\')
+            if ((fs_len==1 && (*p==*(po->fieldSep))) || *p=='\\' || *p=='\n')
               *(o++)='\\';
             if (po->align && (*pval=='E' || *pval=='e' ||
                               !((*p>='0' && *p<='9') ||