Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
pwmt
zathura
Commits
7b0aab74
Commit
7b0aab74
authored
Mar 24, 2012
by
Sebastian Ramacher
Browse files
If there is only one directory append a /.
parent
338c7e5f
Changes
1
Hide whitespace changes
Inline
Side-by-side
completion.c
View file @
7b0aab74
...
@@ -82,9 +82,6 @@ list_files(zathura_t* zathura, const char* current_path, const char* current_fil
...
@@ -82,9 +82,6 @@ list_files(zathura_t* zathura, const char* current_path, const char* current_fil
g_free
(
full_path
);
g_free
(
full_path
);
continue
;
continue
;
}
}
char
*
tmp_path
=
full_path
;
full_path
=
g_strdup_printf
(
"%s/"
,
full_path
);
g_free
(
tmp_path
);
girara_list_append
(
res
,
full_path
);
girara_list_append
(
res
,
full_path
);
}
else
if
(
check_file_ext
==
false
||
file_valid_extension
(
zathura
,
full_path
)
==
true
)
{
}
else
if
(
check_file_ext
==
false
||
file_valid_extension
(
zathura
,
full_path
)
==
true
)
{
girara_list_append
(
res
,
full_path
);
girara_list_append
(
res
,
full_path
);
...
@@ -95,6 +92,16 @@ list_files(zathura_t* zathura, const char* current_path, const char* current_fil
...
@@ -95,6 +92,16 @@ list_files(zathura_t* zathura, const char* current_path, const char* current_fil
}
}
g_dir_close
(
dir
);
g_dir_close
(
dir
);
if
(
girara_list_size
(
res
)
==
1
)
{
char
*
path
=
girara_list_nth
(
res
,
0
);
if
(
g_file_test
(
path
,
G_FILE_TEST_IS_DIR
)
==
true
)
{
char
*
newpath
=
g_strdup_printf
(
"%s/"
,
path
);
girara_list_clear
(
res
);
girara_list_append
(
res
,
newpath
);
}
}
return
res
;
return
res
;
error_free:
error_free:
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment