Index: build.conf
===================================================================
--- build.conf	(revision 38658)
+++ build.conf	(working copy)
@@ -320,7 +320,7 @@
 path = subversion/libsvn_subr
 libs = aprutil apriconv apr xml zlib apr_memcache sqlite
 msvc-libs = advapi32.lib shfolder.lib ole32.lib crypt32.lib version.lib
-msvc-export = svn_auth.h svn_base64.h svn_checksum.h svn_cmdline.h svn_compat.h svn_config.h svn_ctype.h svn_dirent_uri.h svn_dso.h svn_error.h svn_hash.h svn_io.h svn_iter.h svn_md5.h svn_mergeinfo.h svn_nls.h svn_opt.h svn_path.h svn_pools.h svn_props.h svn_quoprint.h svn_sorts.h svn_string.h svn_subst.h svn_time.h svn_types.h svn_user.h svn_utf.h svn_version.h svn_xml.h private\svn_atomic.h private\svn_cache.h private\svn_cmdline_private.h private\svn_log.h private\svn_mergeinfo_private.h private\svn_opt_private.h private\svn_patch.h private\svn_skel.h private\svn_sqlite.h private\svn_utf_private.h
+msvc-export = svn_auth.h svn_base64.h svn_checksum.h svn_cmdline.h svn_compat.h svn_config.h svn_ctype.h svn_dirent_uri.h svn_dso.h svn_error.h svn_hash.h svn_io.h svn_iter.h svn_md5.h svn_mergeinfo.h svn_nls.h svn_opt.h svn_path.h svn_pools.h svn_props.h svn_quoprint.h svn_sorts.h svn_string.h svn_subst.h svn_time.h svn_types.h svn_user.h svn_utf.h svn_version.h svn_xml.h private\svn_atomic.h private\svn_cache.h private\svn_cmdline_private.h private\svn_log.h private\svn_mergeinfo_private.h private\svn_opt_private.h private\svn_patch.h private\svn_skel.h private\svn_sqlite.h private\svn_utf_private.h private\svn_eol_private.h
 
 # Working copy management lib
 [libsvn_wc]
Index: subversion/libsvn_diff/diff_file.c
===================================================================
--- subversion/libsvn_diff/diff_file.c	(revision 38658)
+++ subversion/libsvn_diff/diff_file.c	(working copy)
@@ -45,6 +45,7 @@
 #include "svn_ctype.h"
 
 #include "private/svn_utf_private.h"
+#include "private/svn_eol_private.h"
 
 /* A token, i.e. a line read from a file. */
 typedef struct svn_diff__file_token_t
Index: subversion/libsvn_subr/subst.c
===================================================================
--- subversion/libsvn_subr/subst.c	(revision 38658)
+++ subversion/libsvn_subr/subst.c	(working copy)
@@ -1647,94 +1647,3 @@
 
   return SVN_NO_ERROR;
 }
-
-char *
-svn_subst_find_eol_start(char *buf, apr_size_t len)
-{
-  for (; len > 0; ++buf, --len)
-    {
-      if (*buf == '\n' || *buf == '\r')
-        return buf;
-    }
-  return NULL;
-}
-
-const char *
-svn_subst_detect_eol(char *buf, char *endp)
-{
-  const char *eol;
-  
-  SVN_ERR_ASSERT_NO_RETURN(buf <= endp);
-  eol = svn_subst_find_eol_start(buf, endp - buf);
-  if (eol)
-    {
-      if (*eol == '\n')
-        return "\n";
-
-      /* We found a CR. */
-      ++eol;
-      if (eol == endp || *eol != '\n')
-        return "\r";
-      return "\r\n";
-    }
-
-  return NULL;
-}
-
-svn_error_t *
-svn_subst_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 occured. 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_subst_detect_eol(buf, buf + nbytes);
-    }
-  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;
-}
Index: subversion/libsvn_subr/eol.c
===================================================================
--- subversion/libsvn_subr/eol.c	(revision 0)
+++ subversion/libsvn_subr/eol.c	(revision 0)
@@ -0,0 +1,140 @@
+/*
+ * eol.c :  generic eol/keyword routines
+ *
+ * ====================================================================
+ *    Licensed to the Subversion Corporation (SVN Corp.) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The SVN Corp. licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
+ */
+
+
+
+#define APR_WANT_STRFUNC
+#include <apr_want.h>
+
+#include <stdlib.h>
+#include <assert.h>
+#include <apr_pools.h>
+#include <apr_tables.h>
+#include <apr_file_io.h>
+#include <apr_strings.h>
+
+#include "svn_cmdline.h"
+#include "svn_types.h"
+#include "svn_string.h"
+#include "svn_time.h"
+#include "svn_dirent_uri.h"
+#include "svn_path.h"
+#include "svn_error.h"
+#include "svn_utf.h"
+#include "svn_io.h"
+#include "svn_subst.h"
+#include "svn_pools.h"
+
+#include "svn_private_config.h"
+#include "private/svn_eol_private.h"
+
+char *
+svn_subst_find_eol_start(char *buf, apr_size_t len)
+{
+  for (; len > 0; ++buf, --len)
+    {
+      if (*buf == '\n' || *buf == '\r')
+        return buf;
+    }
+  return NULL;
+}
+
+const char *
+svn_subst_detect_eol(char *buf, char *endp)
+{
+  const char *eol;
+  
+  SVN_ERR_ASSERT_NO_RETURN(buf <= endp);
+  eol = svn_subst_find_eol_start(buf, endp - buf);
+  if (eol)
+    {
+      if (*eol == '\n')
+        return "\n";
+
+      /* We found a CR. */
+      ++eol;
+      if (eol == endp || *eol != '\n')
+        return "\r";
+      return "\r\n";
+    }
+
+  return NULL;
+}
+
+svn_error_t *
+svn_subst_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 occured. 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_subst_detect_eol(buf, buf + nbytes);
+    }
+  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;
+}
Index: subversion/tests/libsvn_subr/subst-test.c
===================================================================
--- subversion/tests/libsvn_subr/subst-test.c	(revision 38658)
+++ subversion/tests/libsvn_subr/subst-test.c	(working copy)
@@ -28,6 +28,7 @@
 #include "svn_subst.h"
 
 #include "../svn_test.h"
+#include "private/svn_eol_private.h"
 
 
 
Index: subversion/include/svn_subst.h
===================================================================
--- subversion/include/svn_subst.h	(revision 38658)
+++ subversion/include/svn_subst.h	(working copy)
@@ -570,48 +570,6 @@
                                           svn_boolean_t for_output,
                                           apr_pool_t *pool);
 
-/* Generic EOL character helper routines */
-
-/* Look for the start of an end-of-line sequence (i.e. CR or LF)
- * in the array pointed to by @a buf , of length @a len.
- * If such a byte is found, return the pointer to it, else return NULL.
- *
- * @since New in 1.7
- */
-char *
-svn_subst_find_eol_start(char *buf, apr_size_t len);
-
-/* Return the first eol marker found in [@a buf, @a endp) as a
- * NUL-terminated string, or NULL if no eol marker is found.
- *
- * If the last valid character of @a buf is the first byte of a
- * potentially two-byte eol sequence, just return that single-character
- * sequence, that is, assume @a buf represents a CR-only or LF-only file.
- * This is correct for callers that pass an entire file at once, and is
- * no more likely to be incorrect than correct for any caller that
- * doesn't.
- *
- * @since New in 1.7
- */
-const char *
-svn_subst_detect_eol(char *buf, char *endp);
-
-/* Detect the EOL marker used in @a file and return it in @a *eol.
- * 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 returnd. 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.
- *
- * Do temporary allocations in @a pool.
- *
- * @since New in 1.7 */
-svn_error_t *
-svn_subst_detect_file_eol(const char **eol, apr_file_t *file, apr_pool_t *pool);
-
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
Index: subversion/include/private/svn_eol_private.h
===================================================================
--- subversion/include/private/svn_eol_private.h	(revision 0)
+++ subversion/include/private/svn_eol_private.h	(revision 0)
@@ -0,0 +1,86 @@
+/**
+ * @copyright
+ * ====================================================================
+ *    Licensed to the Subversion Corporation (SVN Corp.) under one
+ *    or more contributor license agreements.  See the NOTICE file
+ *    distributed with this work for additional information
+ *    regarding copyright ownership.  The SVN Corp. licenses this file
+ *    to you under the Apache License, Version 2.0 (the
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
+ * @endcopyright
+ *
+ * @file svn_auth_private.h
+ * @brief Subversion's authentication system - Internal routines
+ */
+
+#ifndef SVN_EOL_PRIVATE_H
+#define SVN_EOL_PRIVATE_H
+
+#include <apr_pools.h>
+#include <apr_hash.h>
+
+#include "svn_types.h"
+#include "svn_error.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+/* Generic EOL character helper routines */
+
+/* Look for the start of an end-of-line sequence (i.e. CR or LF)
+ * in the array pointed to by @a buf , of length @a len.
+ * If such a byte is found, return the pointer to it, else return NULL.
+ *
+ * @since New in 1.7
+ */
+char *
+svn_subst_find_eol_start(char *buf, apr_size_t len);
+
+/* Return the first eol marker found in [@a buf, @a endp) as a
+ * NUL-terminated string, or NULL if no eol marker is found.
+ *
+ * If the last valid character of @a buf is the first byte of a
+ * potentially two-byte eol sequence, just return that single-character
+ * sequence, that is, assume @a buf represents a CR-only or LF-only file.
+ * This is correct for callers that pass an entire file at once, and is
+ * no more likely to be incorrect than correct for any caller that
+ * doesn't.
+ *
+ * @since New in 1.7
+ */
+const char *
+svn_subst_detect_eol(char *buf, char *endp);
+
+/* Detect the EOL marker used in @a file and return it in @a *eol.
+ * 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 returnd. 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.
+ *
+ * Do temporary allocations in @a pool.
+ *
+ * @since New in 1.7 */
+svn_error_t *
+svn_subst_detect_file_eol(const char **eol, apr_file_t *file, apr_pool_t *pool);
+
+#ifdef __cplusplus
+}
+#endif /* __cplusplus */
+
+#endif /* SVN_EOL_PRIVATE_H */
Index: subversion/libsvn_client/patch.c
===================================================================
--- subversion/libsvn_client/patch.c	(revision 38658)
+++ subversion/libsvn_client/patch.c	(working copy)
@@ -45,6 +45,7 @@
 
 #include "svn_private_config.h"
 #include "private/svn_diff_private.h"
+#include "private/svn_eol_private.h"
 
 
 /*** Code. ***/
