[interchange-cvs] interchange - kwalsh modified code/UI_Tag/import_fields.coretag

interchange-core@icdevgroup.org interchange-core@icdevgroup.org
Fri Nov 1 14:39:00 2002


User:      kwalsh
Date:      2002-11-01 19:38:44 GMT
Modified:  code/UI_Tag import_fields.coretag
Log:
	* Further enhanced the previous "strip line endings" patch to
	  take Mac line endings into account as well as DOS and UNIX.

	* Switched to using "\015\012" instead of "\r\n" as per Jon's
	  suggestion.

Revision  Changes    Path
1.5       +3 -3      interchange/code/UI_Tag/import_fields.coretag


rev 1.5, prev_rev 1.4
Index: import_fields.coretag
===================================================================
RCS file: /var/cvs/interchange/code/UI_Tag/import_fields.coretag,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- import_fields.coretag	31 Oct 2002 17:54:11 -0000	1.4
+++ import_fields.coretag	1 Nov 2002 19:38:43 -0000	1.5
@@ -177,13 +177,13 @@
   TABLE: {
 	if(! $table) {
 		$table = <UPDATE>;
-		$table =~ s/\r?\n$//;
+		$table =~ s/(\015\012|\015|\012)$//;
 		$change_sub->($table);
 	}
 #::logDebug("db now=$db");
 	if(! $opt->{fields}) {
 		$fields = <UPDATE>;
-		$fields =~ s/\r?\n$//;
+		$fields =~ s/(\015\012|\015|\012)$//;
 		$fields =~ s/$delimiter/ /g;
 		$out .= "${tmsg}Using fields from file: '$fields'\n";
 	}
@@ -211,7 +211,7 @@
 	my $delcount = 0;
 	my $addcount = 0;
 	while(<UPDATE>) {
-		s/\r?\n$//;
+		s/(\015\012|\015|\012)$//;
 		$totcount++;
 		($k, @f) = split /$delimiter/o, $_;
 		if(/^\f(\w+)$/) {