Index: go-file.c
===================================================================
RCS file: /cvs/gnome/gnumeric/src/cut-n-paste-code/goffice/utils/go-file.c,v
retrieving revision 1.17
diff -p -u -b -r1.17 go-file.c
--- go-file.c	10 Dec 2004 04:51:31 -0000	1.17
+++ go-file.c	14 Dec 2004 13:24:03 -0000
@@ -177,9 +177,8 @@ go_dirname_from_uri (const char *uri, gb
 	g_free (raw_uri);
 #else
 	char *uri_dirname = g_path_get_dirname (uri);
-	char *dir = uri_dirname ? go_filename_from_uri (uri_dirname) : NULL;
+	dirname = uri_dirname ? go_filename_from_uri (uri_dirname) : NULL;
 	dirname = dirname ? g_strconcat ("file://", dirname, NULL) : NULL;
-	g_free (dir);
 	g_free (uri_dirname);
 #endif
 
@@ -426,15 +425,33 @@ go_url_show (gchar const *url)
 	if (browser == NULL &&
 	    RegOpenKeyEx (HKEY_CLASSES_ROOT, "http\\shell\\open\\command", 0, KEY_READ, &hKey) == ERROR_SUCCESS) {
 		if(RegQueryValueEx (hKey, NULL, NULL, &lType, NULL, &dwSize) == ERROR_SUCCESS) {
-			unsigned char *buf = g_new (unsigned char, dwSize + 1);
+			gchar *buf, *tmp, *progname, *shortname, *p, c;
+
+			buf = g_new (gchar, dwSize + 1);
 			RegQueryValueEx (hKey, NULL, NULL, &lType, buf, &dwSize);
-			browser = check_program (buf);
+			progname = tmp = g_strdup (buf);
+			if (tmp[0] == '"')
+			{
+				c = '"';
+				++progname;
+			}
+			else
+				c = ' ';
+			for (p = progname; p[0] && p[0] != c; ++p);
+			p[0] = '\0';
+			shortname = g_new (gchar, MAX_PATH);
+			GetShortPathName (progname, shortname, MAX_PATH);
+			g_free (tmp);
+			if (check_program (shortname))
+				browser = buf;
+			else
 			g_free (buf);
+			g_free (shortname);
 		}
 		RegCloseKey(hKey);
 	}
 
-	/* some win32 specific url cleanup */
+	/* some win32 specific url cleanup
 	If this is a file:// URL, strip off file:// and make it backslashed */
 	if (g_ascii_strncasecmp (url, "file://", 7) == 0) {
 		url += 7;
@@ -493,7 +510,7 @@ go_url_show (gchar const *url)
 			for (i = 1 ; i < argc ; i++)
 				if (NULL != (tmp = strstr (argv[i], "%1"))) {
 					*tmp = '\0';
-					tmp = g_strconcat = (argv[i],
+					tmp = g_strconcat (argv[i],
 						(clean_url != NULL) ? (char const *)clean_url : url,
 						tmp+2, NULL);
 					g_free (argv[i]);
