Re: script files with DOS line endings

2003-12-15 Thread Alexander V. Lukyanov
On Sun, Dec 14, 2003 at 12:30:46PM -0500, Mark Blackburn wrote:
 lftp doesn't recognize DOS style text files that end in \r\n instead
 of the more sensible \n. I'm using the following patch in the next
 cygwin release of lftp to allow the use of DOS text files.

Patch applied. Thanks!

--
   Alexander.


script files with DOS line endings

2003-12-14 Thread Mark Blackburn
lftp doesn't recognize DOS style text files that end in \r\n instead
of the more sensible \n. I'm using the following patch in the next
cygwin release of lftp to allow the use of DOS text files.
Patch is against lftp-2.6.9

Mark Blackburn

diff -urN -x .build -x .inst -x .sinst lftp-2.6.9-orig/src/parsecmd.cc lftp-2.6.9/src/parsecmd.cc
--- lftp-2.6.9-orig/src/parsecmd.cc	2002-06-11 03:36:56.0 -0400
+++ lftp-2.6.9/src/parsecmd.cc	2003-12-13 22:21:56.249894400 -0500
@@ -93,6 +93,9 @@
 	 continue;   // and continue skipping space
   }
 
+  if(line[0]=='\r' line[1]=='\n')
+	 line++;
+
   if(*line==0 || *line=='\n'
   || *line=='|' || *line=='' || *line==';' || *line=='')
 	 break;
@@ -201,6 +204,8 @@
 	line+=2;
 	continue;
 	 }
+	 if(line[0]=='\r' line[1]=='\n')
+	line++; 
 	 if(*line=='\\'  quotable(line[1]))
 	 {
 	line++;