mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
Reworked "Special dirs"->"list" parameter handle code
misc/mc.lib: changed ',' to ';' src/treestore.c: use mc_config_get_string_list() function instread of strtok() function
This commit is contained in:
parent
acc64ecd68
commit
0a1b6bfbb2
@ -1,5 +1,5 @@
|
||||
[Special dirs]
|
||||
list=/afs,/coda,/:,/...,/net,/#smb
|
||||
list=/afs;/coda;/:;/...;/net;/#smb
|
||||
|
||||
[terminal:console]
|
||||
insert=\\e[2~
|
||||
|
@ -728,22 +728,25 @@ tree_store_end_check(void)
|
||||
static void
|
||||
process_special_dirs(GList ** special_dirs, char *file)
|
||||
{
|
||||
char *token;
|
||||
char *buffer;
|
||||
char *s;
|
||||
gchar **buffers, **start_buff;
|
||||
mc_config_t *cfg;
|
||||
gsize buffers_len;
|
||||
|
||||
cfg = mc_config_init(file);
|
||||
if (cfg == NULL)
|
||||
return;
|
||||
|
||||
buffer = mc_config_get_string(cfg, "Special dirs", "list", "");
|
||||
s = buffer;
|
||||
while ((token = strtok(s, ",")) != NULL) {
|
||||
*special_dirs = g_list_prepend(*special_dirs, g_strdup(token));
|
||||
s = NULL;
|
||||
start_buff = buffers = mc_config_get_string_list(cfg, "Special dirs", "list", &buffers_len);
|
||||
if (buffers == NULL){
|
||||
mc_config_deinit(cfg);
|
||||
return;
|
||||
}
|
||||
g_free(buffer);
|
||||
|
||||
while(*buffers) {
|
||||
*special_dirs = g_list_prepend(*special_dirs, g_strdup(*buffers));
|
||||
buffers++;
|
||||
}
|
||||
g_strfreev(start_buff);
|
||||
mc_config_deinit(cfg);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user