comparison lib/protocols.c @ 916:936635b76f02

2007-4-26 Brian Masney <masneyb@gftp.org> * src/gtk/misc-gtk.c lib/gftp.h lib/protocols.c - added filename_utf8_encoded flag to the gftp_file structure. If this is false, then don't attempt to show the filename in the GTK port. The user can still select the blank filename though.
author masneyb
date Thu, 26 Apr 2007 23:47:34 +0000
parents f716c8dbeaff
children b099517df21a
comparison
equal deleted inserted replaced
915:ecac0834d141 916:936635b76f02
701 fle->file = tmpfile; 701 fle->file = tmpfile;
702 } 702 }
703 703
704 if (ret >= 0 && fle->file != NULL) 704 if (ret >= 0 && fle->file != NULL)
705 { 705 {
706 utf8 = gftp_filename_to_utf8 (request, fle->file, &destlen); 706 if (g_utf8_validate (fle->file, -1, NULL))
707 if (utf8 != NULL) 707 fle->filename_utf8_encoded = 1;
708 else
708 { 709 {
709 tmpfile = fle->file; 710 utf8 = gftp_filename_to_utf8 (request, fle->file, &destlen);
710 fle->file = utf8; 711 if (utf8 != NULL)
711 g_free (tmpfile); 712 {
713 g_free (fle->file);
714 fle->file = utf8;
715 fle->filename_utf8_encoded = 1;
716 }
712 } 717 }
713 } 718 }
714 719
715 if (ret >= 0 && !request->cached && request->cachefd > 0 && 720 if (ret >= 0 && !request->cached && request->cachefd > 0 &&
716 request->last_dir_entry != NULL) 721 request->last_dir_entry != NULL)