#!/bin/bash

TMP=/tmp/libsigsegv

[ -e $TMP ] && rm -rf $TMP
mkdir $TMP

for FILE in $(find . -type f); do
	if [ ! -z "$(grep -E """\\bunsigned\\s+long\\b""" $FILE)" ]; then
		[ ! -e $TMP/$(dirname $FILE) ] && mkdir -p $TMP/$(dirname $FILE)
		cat $FILE | sed -r "s/\bunsigned\s+long\b/size_t/g" >$TMP/$FILE
	fi
done
