File tree Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Expand file tree Collapse file tree 1 file changed +12
-6
lines changed Original file line number Diff line number Diff line change 2525 *
2626 *
2727 * IDENTIFICATION
28- * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-misc.c,v 1.48 2001/03/31 23:13:30 tgl Exp $
28+ * $Header: /cvsroot/pgsql/src/interfaces/libpq/fe-misc.c,v 1.49 2001/05/28 15:29:51 tgl Exp $
2929 *
3030 *-------------------------------------------------------------------------
3131 */
@@ -400,14 +400,20 @@ pqReadData(PGconn *conn)
400400 /* Left-justify any data in the buffer to make room */
401401 if (conn -> inStart < conn -> inEnd )
402402 {
403- memmove (conn -> inBuffer , conn -> inBuffer + conn -> inStart ,
404- conn -> inEnd - conn -> inStart );
405- conn -> inEnd -= conn -> inStart ;
406- conn -> inCursor -= conn -> inStart ;
407- conn -> inStart = 0 ;
403+ if (conn -> inStart > 0 )
404+ {
405+ memmove (conn -> inBuffer , conn -> inBuffer + conn -> inStart ,
406+ conn -> inEnd - conn -> inStart );
407+ conn -> inEnd -= conn -> inStart ;
408+ conn -> inCursor -= conn -> inStart ;
409+ conn -> inStart = 0 ;
410+ }
408411 }
409412 else
413+ {
414+ /* buffer is logically empty, reset it */
410415 conn -> inStart = conn -> inCursor = conn -> inEnd = 0 ;
416+ }
411417
412418 /*
413419 * If the buffer is fairly full, enlarge it. We need to be able to
You can’t perform that action at this time.
0 commit comments