subversion-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1129955 - in /subversion/trunk: build.conf subversion/include/private/svn_eol_private.h subversion/libsvn_subr/eol.c subversion/tests/libsvn_subr/eol-test.c
Date Tue, 31 May 2011 22:56:23 GMT
Author: stsp
Date: Tue May 31 22:56:23 2011
New Revision: 1129955

URL: http://svn.apache.org/viewvc?rev=1129955&view=rev
Log:
Remove svn_eol__detect_file_eol() which was added during 1.7 development
but is now unused. It also had known bugs.

* subversion/include/private/svn_eol_private.h
  (svn_eol__detect_file_eol): Remove declaration and docstring.

* subversion/libsvn_subr/eol.c
  (svn_eol__detect_file_eol): Remove.

* subversion/tests/libsvn_subr/eol-test.c: Remove this entire file since
   it was only testing svn_eol__detect_file_eol().

* build.conf: Adjust for removed file. Hope I won't break the Windows build.

Removed:
    subversion/trunk/subversion/tests/libsvn_subr/eol-test.c
Modified:
    subversion/trunk/build.conf
    subversion/trunk/subversion/include/private/svn_eol_private.h
    subversion/trunk/subversion/libsvn_subr/eol.c

Modified: subversion/trunk/build.conf
URL: http://svn.apache.org/viewvc/subversion/trunk/build.conf?rev=1129955&r1=1129954&r2=1129955&view=diff
==============================================================================
--- subversion/trunk/build.conf (original)
+++ subversion/trunk/build.conf Tue May 31 22:56:23 2011
@@ -828,14 +828,6 @@ sources = string-test.c
 install = test
 libs = libsvn_test libsvn_subr apriconv apr
 
-[eol-test]
-description = Test EOL routines
-type = exe
-path = subversion/tests/libsvn_subr
-sources = eol-test.c
-install = test
-libs = libsvn_test libsvn_subr apriconv apr
-
 [time-test]
 description = Test time functions
 type = exe
@@ -1124,7 +1116,7 @@ libs = __ALL__
        fs-test fs-base-test fs-fsfs-test fs-pack-test skel-test key-test
        strings-reps-test changes-test locks-test repos-test
        checksum-test compat-test config-test hashdump-test mergeinfo-test
-       opt-test path-test stream-test string-test eol-test time-test utf-test
+       opt-test path-test stream-test string-test time-test utf-test
        target-test error-test cache-test
        revision-test
        subst_translate-test

Modified: subversion/trunk/subversion/include/private/svn_eol_private.h
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/include/private/svn_eol_private.h?rev=1129955&r1=1129954&r2=1129955&view=diff
==============================================================================
--- subversion/trunk/subversion/include/private/svn_eol_private.h (original)
+++ subversion/trunk/subversion/include/private/svn_eol_private.h Tue May 31 22:56:23 2011
@@ -72,31 +72,6 @@ svn_eol__find_eol_start(char *buf, apr_s
 const char *
 svn_eol__detect_eol(char *buf, apr_size_t len, char **eolp);
 
-/* Set @a *eol to the EOL marker used in @a file.
- * If it cannot be detected, set @a *eol to NULL.
- *
- * The file is searched starting at the current file cursor position.
- * The first EOL marker found will be returned. So if the file has
- * inconsistent EOL markers, this won't be detected.
- *
- * Upon return, the original file cursor position is always preserved,
- * even if an error is thrown.
- *
- * The string @a *eol is statically allocated.
- * Do temporary allocations in @a pool.
- *
- * ### [JAF] Apparent bug: implementation suffers from the "one byte of a
- *     two-byte sequence" issue noted for svn_eol__detect_eol().
- *
- * ### [JAF] Apparent bug: if file pointer is at EOF, returns "success"
- *     without initializing @a *eol.
- *
- * ### [JAF] Wouldn't it make more sense to accept a stream than a file?
- *
- * @since New in 1.7 */
-svn_error_t *
-svn_eol__detect_file_eol(const char **eol, apr_file_t *file, apr_pool_t *pool);
-
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */

Modified: subversion/trunk/subversion/libsvn_subr/eol.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_subr/eol.c?rev=1129955&r1=1129954&r2=1129955&view=diff
==============================================================================
--- subversion/trunk/subversion/libsvn_subr/eol.c (original)
+++ subversion/trunk/subversion/libsvn_subr/eol.c Tue May 31 22:56:23 2011
@@ -118,61 +118,3 @@ svn_eol__detect_eol(char *buf, apr_size_
 
   return NULL;
 }
-
-svn_error_t *
-svn_eol__detect_file_eol(const char **eol, apr_file_t *file, apr_pool_t *pool)
-{
-  char buf[512];
-  apr_size_t nbytes;
-  svn_error_t *err;
-  apr_off_t orig_pos;
-  apr_off_t pos;
-
-  /* Remember original file offset. */
-  orig_pos = 0;
-  SVN_ERR(svn_io_file_seek(file, APR_CUR, &orig_pos, pool));
-
-  do
-    {
-      memset(buf, '\0', sizeof(buf));
-
-      /* Read a chunk. */
-      nbytes = sizeof(buf);
-      err = svn_io_file_read(file, buf, &nbytes, pool);
-      if (err)
-        {
-          /* An error occurred. We're going to return in any case,
-           * so reset the file cursor right now. */
-          pos = orig_pos;
-          SVN_ERR(svn_io_file_seek(file, APR_SET, &pos, pool));
-          SVN_ERR_ASSERT(orig_pos == pos);
-
-          /* If we reached the end of the file, the file has no
-           * EOL markers at all... */
-          if (APR_STATUS_IS_EOF(err->apr_err))
-            {
-              svn_error_clear(err);
-              return SVN_NO_ERROR;
-            }
-          else
-            {
-              /* Whatever happened, it's something we don't know how
-               * to deal with. Just return the error. */
-              return svn_error_return(err);
-            }
-        }
-
-      /* Try to detect the EOL style of the file by searching the
-       * current chunk. */
-      SVN_ERR_ASSERT(nbytes <= sizeof(buf));
-      *eol = svn_eol__detect_eol(buf, nbytes, NULL);
-    }
-  while (*eol == NULL);
-
-  /* We're done, reset the file cursor to the original offset. */
-  pos = orig_pos;
-  SVN_ERR(svn_io_file_seek(file, APR_SET, &pos, pool));
-  SVN_ERR_ASSERT(orig_pos == pos);
-
-  return SVN_NO_ERROR;
-}



Mime
View raw message