Mercurial > gftp.yaz
comparison lib/sshv2.c @ 845:8263cc35c027
2006-11-2 Brian Masney <masneyb@gftp.org>
* lib/gftp.h lib/local.c lib/misc.c lib/protocols.c lib/rfc959.c
lib/sshv2.c - added gftp_filename_to_utf8() and
gftp_filename_from_utf8().
(gftp_string_from_utf8) - added argument that will force the local
encoding to be used.
author | masneyb |
---|---|
date | Fri, 03 Nov 2006 03:02:51 +0000 |
parents | 32dbed7e0dc4 |
children | 0cf4d8c46b82 |
comparison
equal
deleted
inserted
replaced
844:1ece208d1357 | 845:8263cc35c027 |
---|---|
173 { | 173 { |
174 const char *addstr; | 174 const char *addstr; |
175 char *utf8, *ret; | 175 char *utf8, *ret; |
176 size_t pathlen; | 176 size_t pathlen; |
177 | 177 |
178 utf8 = gftp_string_from_utf8 (request, str, &pathlen); | 178 utf8 = gftp_filename_from_utf8 (request, str, &pathlen); |
179 if (utf8 != NULL) | 179 if (utf8 != NULL) |
180 addstr = utf8; | 180 addstr = utf8; |
181 else | 181 else |
182 { | 182 { |
183 addstr = str; | 183 addstr = str; |
203 if (*str == '/') | 203 if (*str == '/') |
204 path = g_strdup (str); | 204 path = g_strdup (str); |
205 else | 205 else |
206 path = gftp_build_path (request, request->directory, str, NULL); | 206 path = gftp_build_path (request, request->directory, str, NULL); |
207 | 207 |
208 utf8 = gftp_string_from_utf8 (request, path, len); | 208 utf8 = gftp_filename_from_utf8 (request, path, len); |
209 if (utf8 != NULL) | 209 if (utf8 != NULL) |
210 { | 210 { |
211 g_free (path); | 211 g_free (path); |
212 return (utf8); | 212 return (utf8); |
213 } | 213 } |
1060 return (ret); | 1060 return (ret); |
1061 | 1061 |
1062 if ((dir = sshv2_buffer_get_string (request, &message, 1)) == NULL) | 1062 if ((dir = sshv2_buffer_get_string (request, &message, 1)) == NULL) |
1063 return (GFTP_EFATAL); | 1063 return (GFTP_EFATAL); |
1064 | 1064 |
1065 utf8 = gftp_string_to_utf8 (request, dir, &len); | 1065 utf8 = gftp_filename_to_utf8 (request, dir, &len); |
1066 if (utf8 != NULL) | 1066 if (utf8 != NULL) |
1067 { | 1067 { |
1068 request->directory = utf8; | 1068 request->directory = utf8; |
1069 g_free (dir); | 1069 g_free (dir); |
1070 } | 1070 } |