Commit 87675fab authored by Bruce Momjian's avatar Bruce Momjian

pgindent copy.c. Patch wasn't in proper format.

parent 0cd8cb1a
......@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.147 2002/02/24 02:32:26 momjian Exp $
* $Header: /cvsroot/pgsql/src/backend/commands/copy.c,v 1.148 2002/02/24 02:33:33 momjian Exp $
*
*-------------------------------------------------------------------------
*/
......@@ -327,6 +327,7 @@ DoCopy(char *relname, bool binary, bool oids, bool from, bool pipe,
else
{
struct stat st;
fp = AllocateFile(filename, PG_BINARY_R);
if (fp == NULL)
......@@ -335,10 +336,11 @@ DoCopy(char *relname, bool binary, bool oids, bool from, bool pipe,
"reading. Errno = %s (%d).",
(int) geteuid(), filename, strerror(errno), errno);
fstat(fileno(fp),&st);
if( S_ISDIR(st.st_mode) ){
fstat(fileno(fp), &st);
if (S_ISDIR(st.st_mode))
{
FreeFile(fp);
elog(ERROR,"COPY: %s is a directory.",filename);
elog(ERROR, "COPY: %s is a directory.", filename);
}
}
CopyFrom(rel, binary, oids, fp, delim, null_print);
......@@ -387,10 +389,11 @@ DoCopy(char *relname, bool binary, bool oids, bool from, bool pipe,
"effective uid %d, could not open file '%s' for "
"writing. Errno = %s (%d).",
(int) geteuid(), filename, strerror(errno), errno);
fstat(fileno(fp),&st);
if( S_ISDIR(st.st_mode) ){
fstat(fileno(fp), &st);
if (S_ISDIR(st.st_mode))
{
FreeFile(fp);
elog(ERROR,"COPY: %s is a directory.",filename);
elog(ERROR, "COPY: %s is a directory.", filename);
}
}
CopyTo(rel, binary, oids, fp, delim, null_print);
......@@ -1097,25 +1100,25 @@ CopyReadAttribute(FILE *fp, bool *isnull, char *delim, int *newline, char *null_
if (ISOCTAL(c))
{
val = (val << 3) + OCTVALUE(c);
CopyDonePeek(fp, c, true /*pick up*/);
CopyDonePeek(fp, c, true /* pick up */ );
c = CopyPeekChar(fp);
if (ISOCTAL(c))
{
val = (val << 3) + OCTVALUE(c);
CopyDonePeek(fp, c, true /*pick up*/);
CopyDonePeek(fp, c, true /* pick up */ );
}
else
{
if (c == EOF)
goto endOfFile;
CopyDonePeek(fp, c, false /*put back*/);
CopyDonePeek(fp, c, false /* put back */ );
}
}
else
{
if (c == EOF)
goto endOfFile;
CopyDonePeek(fp, c, false /*put back*/);
CopyDonePeek(fp, c, false /* put back */ );
}
c = val & 0377;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment