diff --git a/src/ca65html/ca65html b/src/ca65html/ca65html
index 521c5421c..574b696a8 100755
--- a/src/ca65html/ca65html
+++ b/src/ca65html/ca65html
@@ -560,8 +560,9 @@ sub Process2 {
# Count input lines
$LineNo++;
- # Remove the newline
- chomp ($Line);
+ # Remove the newline at the end of line. Don't use chomp to be able to
+ # read dos/windows sources on unices.
+ $Line =~ s/[\r\n]*$//;
# If requested, convert tabs to spaces
if ($CvtTabs) {