All pastes #552465 Raw Edit

Something

public text v1 · immutable
·published 2007-06-09 09:17 UTC
rendered paste body
gchar *
gnome_vfs_uri_extract_short_name (const GnomeVFSURI *uri)
{
 gchar *escaped_short_path_name, *short_path_name;
 const gchar *host_name;
 const gchar *ret = NULL;
 g_return_val_if_fail (uri != NULL, NULL);
 escaped_short_path_name = gnome_vfs_uri_extract_short_path_name (uri);
 short_path_name = gnome_vfs_unescape_string (escaped_short_path_name, "/");
 g_free (escaped_short_path_name);
 if (short_path_name != NULL
  && strcmp (short_path_name, GNOME_VFS_URI_PATH_STR) != 0) {
  return short_path_name;
 }
 host_name = gnome_vfs_uri_get_host_name (uri);
 if (host_name != NULL && *host_name != '\0') {
  g_free (short_path_name);
  ret = g_strdup (host_name);
 } else if (short_path_name != NULL) {
  ret = short_path_name;
 } else {
  ret = g_strdup (gnome_vfs_uri_get_path (uri));
 }
 g_free(host_name);
 return ret;
}