1#!/bin/sh
2#
3# Convert one or more git patches that have had it's CR:s stripped out by SMTP
4# into something th
5
6if [ $# -lt 1 ]; then
7  echo "usage: `basename $0` <filename>" >&2
8  exit 1
9fi
10
11convert_file()
12{
13  sed -i "s/$/\r/g" "$1"
14  sed -i "s:^\(---\|+++ \)\(.*\)\r$:\1\2:g" "$1"
15}
16
17while [ $# -gt 0 ]; do
18  convert_file "$1"
19  shift
20done
21