File tree 2 files changed +14
-3
lines changed
2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change 7
7
*
8
8
*
9
9
* IDENTIFICATION
10
- * $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.142 1998/05/12 23:05:12 momjian Exp $
10
+ * $Header: /cvsroot/pgsql/src/bin/psql/Attic/psql.c,v 1.143 1998/05/13 03:27:07 momjian Exp $
11
11
*
12
12
*-------------------------------------------------------------------------
13
13
*/
@@ -1988,6 +1988,8 @@ HandleSlashCmds(PsqlSettings *pset,
1988
1988
1989
1989
if (optarg )
1990
1990
fs = optarg ;
1991
+ if (optarg && !* optarg && strlen (cmd ) > 2 )
1992
+ fs = cmd + 2 ;
1991
1993
if (pset -> opt .fieldSep )
1992
1994
free (pset -> opt .fieldSep );
1993
1995
if (!(pset -> opt .fieldSep = strdup (fs )))
Original file line number Diff line number Diff line change 7
7
*
8
8
*
9
9
* IDENTIFICATION
10
- * $Header: /cvsroot/pgsql/src/bin/psql/stringutils.c,v 1.13 1998/02/26 04:39:13 momjian Exp $
10
+ * $Header: /cvsroot/pgsql/src/bin/psql/stringutils.c,v 1.14 1998/05/13 03:27:07 momjian Exp $
11
11
*
12
12
*-------------------------------------------------------------------------
13
13
*/
@@ -56,11 +56,20 @@ leftTrim(char *s)
56
56
char *
57
57
rightTrim (char * s )
58
58
{
59
- char * sEnd ;
59
+ char * sEnd , * bsEnd ;
60
+ bool in_bs = false;
60
61
61
62
sEnd = s + strlen (s ) - 1 ;
62
63
while (sEnd >= s && isspace (* sEnd ))
63
64
sEnd -- ;
65
+ bsEnd = sEnd ;
66
+ while (bsEnd >= s && * bsEnd == '\\' )
67
+ {
68
+ in_bs = (in_bs == false);
69
+ bsEnd -- ;
70
+ }
71
+ if (in_bs && * sEnd )
72
+ sEnd ++ ;
64
73
if (sEnd < s )
65
74
s [0 ] = '\0' ;
66
75
else
You can’t perform that action at this time.
0 commit comments