]> granicus.if.org Git - curl/commitdiff
newlines: fix mixed newlines to LF-only
authorRay Satiro <raysatiro@yahoo.com>
Fri, 12 Sep 2014 08:22:34 +0000 (10:22 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 12 Sep 2014 08:22:34 +0000 (10:22 +0200)
I use the curl repo mainly on Windows with the typical Windows git
checkout which converts the LF line endings in the curl repo to CRLF
automatically on checkout. The automatic conversion is not done on files
in the repo with mixed line endings. I recently noticed some weird
output with projects/build-openssl.bat that I traced back to mixed line
endings, so I scanned the repo and there are files (excluding the
test data) that have mixed line endings.

I used this command below to do the scan. Unfortunately it's not as easy
as git grep, at least not on Windows. This gets the names of all the
files in the repo's HEAD, gets each of those files raw from HEAD, checks
for mixed line endings of both LF and CRLF, and prints the name if
mixed. I excluded path tests/data/test* because those can have mixed
line endings if I understand correctly.

for f in `git ls-tree --name-only --full-tree -r HEAD`;
do if [ -n "${f##tests/data/test*}" ];
    then git show "HEAD:$f" | \
        perl -0777 -ne 'exit 1 if /([^\r]\n.*\r\n)|(\r\n.*[^\r]\n)/';
    if [ $? -ne 0 ];
        then echo "$f";
    fi;
fi;
done

maketgz
projects/build-openssl.bat
winbuild/gen_resp_file.bat

diff --git a/maketgz b/maketgz
index 2967eb3a19f658508a11f6de2e9899de2c1b2297..5aba1a3dcc3027761eae7d9336fbcdf0a9b1b713 100755 (executable)
--- a/maketgz
+++ b/maketgz
@@ -9,7 +9,7 @@
 #                            | (__| |_| |  _ <| |___
 #                             \___|\___/|_| \_\_____|
 #
-# Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.\r
+# Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
 #
 # This software is licensed as described in the file COPYING, which
 # you should have received as part of this distribution. The terms
index 66c8c9a04d6c5487045193a2b5d9dd4de543a8b5..5bd2200f838f09dba2111692284ca87eed4aa7ac 100644 (file)
@@ -86,9 +86,9 @@ rem ***************************************************************************
   shift & goto parseArgs
 
 :prerequisites
-  rem Default the start directory if one isn't specified\r
-  if not defined START_DIR set START_DIR=..\..\openssl\r
-\r
+  rem Default the start directory if one isn't specified
+  if not defined START_DIR set START_DIR=..\..\openssl
+
   rem Calculate the program files directory
   if defined PROGRAMFILES (
     set "PF=%PROGRAMFILES%"
@@ -104,9 +104,9 @@ rem ***************************************************************************
 
   rem Check we have Visual Studio installed
   if not exist "%PF%\%VC_PATH%" goto novc
-\r
-  rem Check the start directory exists\r
-  if not exist "%START_DIR%" goto noopenssl\r
+
+  rem Check the start directory exists
+  if not exist "%START_DIR%" goto noopenssl
 
 :configure
   if "%BUILD_PLATFORM%" == "" (
@@ -260,7 +260,7 @@ rem ***************************************************************************
 :syntax
   rem Display the help
   echo.
-  echo Usage: build-openssl ^<compiler^> ^<platform^> [configuration] [directory]\r
+  echo Usage: build-openssl ^<compiler^> ^<platform^> [configuration] [directory]
   echo.
   echo Compiler:
   echo.
@@ -308,16 +308,16 @@ rem ***************************************************************************
   echo Error: %VC_DESC% is not installed
   goto error
 
-:nox64\r
-  echo.\r
-  echo Error: %VC_DESC% does not support 64-bit builds\r
-  goto error\r
-\r
-:noopenssl\r
-  echo.\r
-  echo Error: Cannot locate OpenSSL source directory\r
-  goto error\r
-\r
+:nox64
+  echo.
+  echo Error: %VC_DESC% does not support 64-bit builds
+  goto error
+
+:noopenssl
+  echo.
+  echo Error: Cannot locate OpenSSL source directory
+  goto error
+
 :error
   if "%OS%" == "Windows_NT" endlocal
   exit /B 1
index d08b01edc158000af4f60c88df970553ace804e3..434f36963f0a9df3f87085560ebe0c67e7ff938b 100755 (executable)
@@ -1,6 +1,6 @@
-@echo OFF\r
-@del %OUTFILE%\r
-@echo %MACRO_NAME% = \> %OUTFILE%\r
+@echo OFF
+@del %OUTFILE%
+@echo %MACRO_NAME% = \> %OUTFILE%
 @for %%i in (%*) do @echo              %DIROBJ%/%%i \>>  %OUTFILE%
-@echo. >>  %OUTFILE%\r
-:END\r
+@echo. >>  %OUTFILE%
+:END