Mercurial > gftp.yaz
diff lib/config_file.c @ 988:63555c9744c2
remote charset should be specified by each bookmark entry.
author | Yoshiki Yazawa <yaz@honeyplanet.jp> |
---|---|
date | Fri, 14 Aug 2009 07:54:55 +0900 |
parents | 85cf59eafce2 |
children |
line wrap: on
line diff
--- a/lib/config_file.c Wed Apr 08 11:07:35 2009 +0000 +++ b/lib/config_file.c Fri Aug 14 07:54:55 2009 +0900 @@ -255,6 +255,13 @@ g_free (newentry->local_dir); newentry->local_dir = g_strdup (curpos); } + else if (strncmp (buf, "remote_charset", 14) == 0 && newentry) + { + curpos = buf + 15; + if (newentry->remote_charset) + g_free (newentry->remote_charset); + newentry->remote_charset = g_strdup (curpos); + } else if (strncmp (buf, "username", 8) == 0 && newentry) { curpos = buf + 9; @@ -776,13 +783,14 @@ password = NULL; fprintf (bmfile, - "[%s]\nhostname=%s\nport=%u\nprotocol=%s\nremote directory=%s\nlocal directory=%s\nusername=%s\npassword=%s\naccount=%s\n", + "[%s]\nhostname=%s\nport=%u\nprotocol=%s\nremote directory=%s\nlocal directory=%s\nremote_charset=%s\nusername=%s\npassword=%s\naccount=%s\n", tempstr, tempentry->hostname == NULL ? "" : tempentry->hostname, tempentry->port, tempentry->protocol == NULL || *tempentry->protocol == '\0' ? gftp_protocols[0].name : tempentry->protocol, tempentry->remote_dir == NULL ? "" : tempentry->remote_dir, tempentry->local_dir == NULL ? "" : tempentry->local_dir, + tempentry->remote_charset == NULL ? "" : tempentry->remote_charset, tempentry->user == NULL ? "" : tempentry->user, password == NULL ? "" : password, tempentry->acct == NULL ? "" : tempentry->acct); @@ -1281,14 +1289,18 @@ (tmpconfigvar = g_hash_table_lookup (gftp_global_options_htable, key)) != NULL) memcpy (value, &tmpconfigvar->value, sizeof (value)); - else if ((tmplistvar = g_hash_table_lookup (gftp_config_list_htable, + else if ((tmplistvar = g_hash_table_lookup (gftp_config_list_htable, key)) != NULL) *(gftp_config_list_vars **) value = tmplistvar; else +#if 0 { fprintf (stderr, _("FATAL gFTP Error: Config option '%s' not found in global hash table\n"), key); exit (EXIT_FAILURE); } +#else + value = NULL; +#endif }