#!/usr/bin/perl

use strict;

my @files = split('\n', `git ls-files`);

foreach my $fn (@files) {
	my ($dos, $unix) = (0,0);
	open(IN, '<', $fn) or die;
	while(<IN>) {
		if (/\r\n$/s || /\r\0\n$/s) {
			++$dos;
		} elsif (/[^\r]\n$/s || /[^\r]\0\n$/s) {
			++$unix;
		}
	}
	close(IN);
	if ($dos != 0 && $unix == 0) {
		print "DOS  $fn\n";
	} elsif ($unix != 0 && $dos == 0) {
		print "UNIX $fn\n";
	} elsif ($unix == 0 && $dos == 0) {
		print "NONE $fn\n";
	} else {
		print "??   $fn DOS $dos UNIX $unix\n";
	}
}
