Revision 3192

View differences:

libsylph/folder.c
1145 1145
			path = path_;
1146 1146
		}
1147 1147
	} else if (FOLDER_TYPE(folder) == F_IMAP) {
1148
		gchar *server;
1148 1149
		gchar *uid;
1149 1150

  
1150 1151
		g_return_val_if_fail(folder->account != NULL, NULL);
1152
		server = uriencode_for_filename(folder->account->recv_server);
1151 1153
		uid = uriencode_for_filename(folder->account->userid);
1152 1154
		path = g_strconcat(get_imap_cache_dir(),
1153
				   G_DIR_SEPARATOR_S,
1154
				   folder->account->recv_server,
1155
				   G_DIR_SEPARATOR_S, server,
1155 1156
				   G_DIR_SEPARATOR_S, uid, NULL);
1156 1157
		g_free(uid);
1158
		g_free(server);
1157 1159
	} else if (FOLDER_TYPE(folder) == F_NEWS) {
1160
		gchar *server;
1161

  
1158 1162
		g_return_val_if_fail(folder->account != NULL, NULL);
1163
		server = uriencode_for_filename(folder->account->nntp_server);
1159 1164
		path = g_strconcat(get_news_cache_dir(),
1160
				   G_DIR_SEPARATOR_S,
1161
				   folder->account->nntp_server,
1162
				   NULL);
1165
				   G_DIR_SEPARATOR_S, server, NULL);
1166
		g_free(server);
1163 1167
	} else
1164 1168
		path = NULL;
1165 1169

  
libsylph/news.c
181 181
{
182 182
	if (REMOTE_FOLDER(folder)->remove_cache_on_destroy) {
183 183
		gchar *dir;
184
		gchar *server;
184 185

  
185 186
		dir = folder_get_path(folder);
186 187
		if (is_dir_exist(dir))
187 188
			remove_dir_recursive(dir);
188 189
		g_free(dir);
189 190

  
191
		server = uriencode_for_filename(folder->account->nntp_server);
190 192
		dir = g_strconcat(get_news_cache_dir(), G_DIR_SEPARATOR_S,
191
				  folder->account->nntp_server, NULL);
193
				  server, NULL);
192 194
		if (is_dir_exist(dir))
193 195
			g_rmdir(dir);
194 196
		g_free(dir);
197
		g_free(server);
195 198
	}
196 199

  
197 200
	folder_remote_folder_destroy(REMOTE_FOLDER(folder));
libsylph/imap.c
487 487

  
488 488
	if (REMOTE_FOLDER(folder)->remove_cache_on_destroy) {
489 489
		gchar *dir;
490
		gchar *server;
490 491

  
491 492
		dir = folder_get_path(folder);
492 493
		if (is_dir_exist(dir))
493 494
			remove_dir_recursive(dir);
494 495
		g_free(dir);
495 496

  
497
		server = uriencode_for_filename(folder->account->recv_server);
496 498
		dir = g_strconcat(get_imap_cache_dir(), G_DIR_SEPARATOR_S,
497
				  folder->account->recv_server, NULL);
499
				  server, NULL);
498 500
		if (is_dir_exist(dir))
499 501
			g_rmdir(dir);
500 502
		g_free(dir);
503
		g_free(server);
501 504
	}
502 505

  
503 506
	folder_remote_folder_destroy(REMOTE_FOLDER(folder));
ChangeLog
1 1
2013-01-22
2 2

  
3
	* libsylph/folder.c
4
	  libsylph/news.c
5
	  libsylph/imap.c: escape server name when creating cache directory
6
	  path (fixes IPv6 address on Windows).
7

  
8
2013-01-22
9

  
3 10
	* libsylph/imap.c: made "INBOX" case insensitive (follow RFC 3501).
4 11

  
5 12
2012-11-20

Also available in: Unified diff