view fix-casts.sh @ 30613:a414593d0a78

Attempt to improve handling of HTTP requests on port 80 when there is a HTTP proxy that requires authentication involved. This also has a fix to make sure that we continue to use the same proxy when we are redirected to an alternative URL. I'm tempted to create a purple_proxy_append_proxy_auth_headers(), but that would have to wait until 2.8.0. Refs #11986. Refs #11908.
author Daniel Atallah <daniel.atallah@gmail.com>
date Mon, 14 Jun 2010 22:09:12 +0000
parents c3ca613ab550
children
line wrap: on
line source

#!/bin/sh

if [ $# -eq 0 ]; then
	echo "Usage: `basename "$0"` PurpleFoo..."
	echo
	echo "This script searches the *current working directory* and replaces casts"
	echo "with GObject-style type checking and casting macros."
	echo 'For example, "(PurpleBuddy *)b" becomes "PURPLE_BUDDY(b)".'
	exit 0
fi

for struct in $* ; do
	cast=`echo $struct | sed "s|[A-Z]|_\0|g" | tr "a-z" "A-Z" | sed "s|^_||"`
	for file in `grep -rl "([[:space:]]*$struct[[:space:]]*\*[[:space:]]*)" . --include=*.c --exclude=purple-client-bindings.c` ; do
		sed -i "s|([[:space:]]*$struct[[:space:]]*\*[[:space:]]*)[[:space:]]*(|$cast(|g" $file
		sed -i "s|([[:space:]]*$struct[[:space:]]*\*[[:space:]]*)[[:space:]]*\([^(][^,);]*\)|$cast(\1)|g" $file
	done
done