Skip to content

Commit 5da7e53

Browse files
committed
Don't strip trailing backslashes from a line. Treat them more reasonably.
1 parent 4fa3738 commit 5da7e53

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed

src/bin/psql/command.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright 2000 by PostgreSQL Global Development Group
55
*
6-
* $Header: /cvsroot/pgsql/src/bin/psql/command.c,v 1.34 2000/06/26 14:16:34 momjian Exp $
6+
* $Header: /cvsroot/pgsql/src/bin/psql/command.c,v 1.35 2000/07/17 18:24:32 petere Exp $
77
*/
88
#include "postgres.h"
99
#include "command.h"
@@ -111,6 +111,9 @@ HandleSlashCmds(const char *line,
111111
{
112112
continue_parse = &my_line[blank_loc];
113113
my_line[blank_loc] = '\0';
114+
/* If it's a double backslash, we skip it. */
115+
if (my_line[blank_loc + 1] == '\\')
116+
continue_parse += 2;
114117
}
115118
/* do we have an option string? */
116119
else if (my_line[blank_loc] != '\0')

src/bin/psql/mainloop.c

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
*
44
* Copyright 2000 by PostgreSQL Global Development Group
55
*
6-
* $Header: /cvsroot/pgsql/src/bin/psql/mainloop.c,v 1.33 2000/07/14 15:43:49 thomas Exp $
6+
* $Header: /cvsroot/pgsql/src/bin/psql/mainloop.c,v 1.34 2000/07/17 18:24:33 petere Exp $
77
*/
88
#include "postgres.h"
99
#include "mainloop.h"
@@ -248,17 +248,6 @@ MainLoop(FILE *source)
248248

249249
pset.lineno++;
250250

251-
/* strip trailing backslashes, they don't have a clear meaning */
252-
while (1)
253-
{
254-
char *cp = strrchr(line, '\\');
255-
256-
if (cp && (*(cp + 1) == '\0'))
257-
*cp = '\0';
258-
else
259-
break;
260-
}
261-
262251
/* nothing left on line? then ignore */
263252
if (line[0] == '\0')
264253
{

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy