* Processed with rstrip-whitespace.py script added to scripts/ directory. * Script run on all .c and .h files in src/ and plugins/ directories. * Also remove more than one newline at the end of files.
		
			
				
	
	
		
			24 lines
		
	
	
		
			531 B
		
	
	
	
		
			Python
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			24 lines
		
	
	
		
			531 B
		
	
	
	
		
			Python
		
	
	
		
			Executable File
		
	
	
	
	
| #!/usr/bin/env python
 | |
| 
 | |
| import sys
 | |
| 
 | |
| filenames = sys.argv[1:]
 | |
| 
 | |
| def backup_file (fn):
 | |
|     open ("%s~" % fn, "w").write (open (fn, "r").read ())
 | |
| 
 | |
| for fn in filenames:
 | |
|   #backup_file (fn)
 | |
|   contents = open (fn, "r").read ()
 | |
|   lines = contents.split ('\n')
 | |
|   with open (fn, "w") as fobj:
 | |
|     for line in lines:
 | |
|       line = line.rstrip ()
 | |
|       fobj.write ("%s\n" % line)
 | |
|   contents = open (fn, "r").read ()
 | |
|   contents.rstrip ()
 | |
|   while contents[-1] in " \t\r\n":
 | |
|     contents = contents[:-1]
 | |
|   open (fn, "w").write ("%s\n" % contents)
 | |
| 
 |