Another attempt at making mingw work
diff --git a/link.sh b/link.sh
index ead078f..9ed3895 100755
--- a/link.sh
+++ b/link.sh
@@ -34,15 +34,14 @@
 	if [ ! -L "$exe" ]; then
 
 		base=$(basename "$exe")
+		ext="${base##*.}"
 
-		if [ "${base##*.}" != "$base" ]; then
-			base=${base%.*}
-			name=${$exe/$base/$link}
+		if [ "$ext" != "$base" ]; then
+			name="$link.$ext"
 		else
 			name="$link"
 		fi
 
-
 		ln -s "$exe" "./$name"
 
 		exit 0