Apply maemo2 patch
[opencv] / utils / dos2unix.py
1 #!/usr/bin/env python
2 ###############
3 import sys
4
5 for fname in sys.argv[1:]:
6     infile = open( fname, "rb" )
7     instr = infile.read()
8     infile.close()
9     outstr = instr.replace( "\r\n", "\n" ).replace( "\r", "\n" )
10
11     if len(outstr) == len(instr):
12         continue
13     
14     outfile = open( fname, "wb" )
15     outfile.write( outstr )
16     outfile.close()
17