subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bl...@apache.org
Subject svn commit: r1068516 - /subversion/trunk/subversion/libsvn_subr/stream.c
Date Tue, 08 Feb 2011 18:40:25 GMT
Author: blair
Date: Tue Feb  8 18:40:25 2011
New Revision: 1068516

URL: http://svn.apache.org/viewvc?rev=1068516&view=rev
Log:
Seeking in an APR stream with a stream marker should not modify the
marker under any circumstances.

* subversion/libsvn_subr/stream.c
  (seek_handler_apr):
    Do not modify the offset inside a struct mark_apr, the APR stream
    specific svn_stream_mark_t.

Modified:
    subversion/trunk/subversion/libsvn_subr/stream.c

Modified: subversion/trunk/subversion/libsvn_subr/stream.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/stream.c?rev=1068516&r1=1068515&r2=1068516&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/stream.c (original)
+++ subversion/trunk/subversion/libsvn_subr/stream.c Tue Feb  8 18:40:25 2011
@@ -611,19 +611,9 @@ static svn_error_t *
 seek_handler_apr(void *baton, svn_stream_mark_t *mark)
 {
   struct baton_apr *btn = baton;
+  apr_off_t offset = (mark != NULL) ? ((const struct mark_apr *)mark)->off : 0;
 
-  if (mark != NULL)
-    {
-      struct mark_apr *mark_apr;
-
-      mark_apr = (struct mark_apr *)mark;
-      SVN_ERR(svn_io_file_seek(btn->file, APR_SET, &mark_apr->off, btn->pool));
-    }
-  else
-    {
-      apr_off_t offset = 0;
-      SVN_ERR(svn_io_file_seek(btn->file, APR_SET, &offset, btn->pool));
-    }
+  SVN_ERR(svn_io_file_seek(btn->file, APR_SET, &offset, btn->pool));
 
   return SVN_NO_ERROR;
 }



Mime
View raw message