3
3
*
4
4
* Copyright 2000 by PostgreSQL Global Development Group
5
5
*
6
- * $Header: /cvsroot/pgsql/src/bin/psql/copy.c,v 1.13 2000/04/12 17:16:22 momjian Exp $
6
+ * $Header: /cvsroot/pgsql/src/bin/psql/copy.c,v 1.14 2000/04/14 23:43:44 petere Exp $
7
7
*/
8
8
#include "postgres.h"
9
9
#include "copy.h"
@@ -82,7 +82,7 @@ parse_slash_copy(const char *args)
82
82
exit (EXIT_FAILURE );
83
83
}
84
84
85
- token = strtokx (line ," \t" ,"\"" ,'\\' ,& quote ,NULL ,pset .encoding );
85
+ token = strtokx (line ," \t\n\r " ,"\"" ,'\\' ,& quote ,NULL ,pset .encoding );
86
86
if (!token )
87
87
error = true;
88
88
else
@@ -92,7 +92,7 @@ parse_slash_copy(const char *args)
92
92
if (!quote && strcasecmp (token ,"binary" )== 0 )
93
93
{
94
94
result -> binary = true;
95
- token = strtokx (NULL ," \t" ,"\"" ,'\\' ,& quote ,NULL ,pset .encoding );
95
+ token = strtokx (NULL ," \t\n\r " ,"\"" ,'\\' ,& quote ,NULL ,pset .encoding );
96
96
if (!token )
97
97
error = true;
98
98
}
@@ -107,22 +107,22 @@ parse_slash_copy(const char *args)
107
107
108
108
if (!error )
109
109
{
110
- token = strtokx (NULL ," \t" ,NULL ,'\\' ,NULL ,NULL ,pset .encoding );
110
+ token = strtokx (NULL ," \t\n\r " ,NULL ,'\\' ,NULL ,NULL ,pset .encoding );
111
111
if (!token )
112
112
error = true;
113
113
else
114
114
{
115
115
if (strcasecmp (token ,"with" )== 0 )
116
116
{
117
- token = strtokx (NULL ," \t" ,NULL ,'\\' ,NULL ,NULL ,pset .encoding );
117
+ token = strtokx (NULL ," \t\n\r " ,NULL ,'\\' ,NULL ,NULL ,pset .encoding );
118
118
if (!token || strcasecmp (token ,"oids" )!= 0 )
119
119
error = true;
120
120
else
121
121
result -> oids = true;
122
122
123
123
if (!error )
124
124
{
125
- token = strtokx (NULL ," \t" ,NULL ,'\\' ,NULL ,NULL ,pset .encoding );
125
+ token = strtokx (NULL ," \t\n\r " ,NULL ,'\\' ,NULL ,NULL ,pset .encoding );
126
126
if (!token )
127
127
error = true;
128
128
}
@@ -139,7 +139,7 @@ parse_slash_copy(const char *args)
139
139
140
140
if (!error )
141
141
{
142
- token = strtokx (NULL ," \t" ,"'" ,'\\' ,& quote ,NULL ,pset .encoding );
142
+ token = strtokx (NULL ," \t\n\r " ,"'" ,'\\' ,& quote ,NULL ,pset .encoding );
143
143
if (!token )
144
144
error = true;
145
145
else if (!quote && (strcasecmp (token ,"stdin" )== 0 || strcasecmp (token ,"stdout" )== 0 ))
@@ -150,21 +150,21 @@ parse_slash_copy(const char *args)
150
150
151
151
if (!error )
152
152
{
153
- token = strtokx (NULL ," \t" ,NULL ,'\\' ,NULL ,NULL ,pset .encoding );
153
+ token = strtokx (NULL ," \t\n\r " ,NULL ,'\\' ,NULL ,NULL ,pset .encoding );
154
154
if (token )
155
155
{
156
156
if (strcasecmp (token ,"using" )== 0 )
157
157
{
158
- token = strtokx (NULL ," \t" ,NULL ,'\\' ,NULL ,NULL ,pset .encoding );
158
+ token = strtokx (NULL ," \t\n\r " ,NULL ,'\\' ,NULL ,NULL ,pset .encoding );
159
159
if (!token || strcasecmp (token ,"delimiters" )!= 0 )
160
160
error = true;
161
161
else
162
162
{
163
- token = strtokx (NULL ," \t" ,"'" ,'\\' ,NULL ,NULL ,pset .encoding );
163
+ token = strtokx (NULL ," \t\n\r " ,"'" ,'\\' ,NULL ,NULL ,pset .encoding );
164
164
if (token )
165
165
{
166
166
result -> delim = xstrdup (token );
167
- token = strtokx (NULL ," \t" ,NULL ,'\\' ,NULL ,NULL ,pset .encoding );
167
+ token = strtokx (NULL ," \t\n\r " ,NULL ,'\\' ,NULL ,NULL ,pset .encoding );
168
168
}
169
169
else
170
170
error = true;
@@ -175,17 +175,17 @@ parse_slash_copy(const char *args)
175
175
{
176
176
if (strcasecmp (token ,"with" )== 0 )
177
177
{
178
- token = strtokx (NULL ," \t" ,NULL ,'\\' ,NULL ,NULL ,pset .encoding );
178
+ token = strtokx (NULL ," \t\n\r " ,NULL ,'\\' ,NULL ,NULL ,pset .encoding );
179
179
if (!token || strcasecmp (token ,"null" )!= 0 )
180
180
error = true;
181
181
else
182
182
{
183
- token = strtokx (NULL ," \t" ,NULL ,'\\' ,NULL ,NULL ,pset .encoding );
183
+ token = strtokx (NULL ," \t\n\r " ,NULL ,'\\' ,NULL ,NULL ,pset .encoding );
184
184
if (!token || strcasecmp (token ,"as" )!= 0 )
185
185
error = true;
186
186
else
187
187
{
188
- token = strtokx (NULL ," \t" ,"'" ,'\\' ,NULL ,NULL ,pset .encoding );
188
+ token = strtokx (NULL ," \t\n\r " ,"'" ,'\\' ,NULL ,NULL ,pset .encoding );
189
189
if (token )
190
190
result -> null = xstrdup (token );
191
191
}