directory_save: pass const pointer to _save()
This commit is contained in:
parent
d54075197f
commit
4af6362751
|
@ -42,9 +42,8 @@ directory_quark(void)
|
|||
}
|
||||
|
||||
void
|
||||
directory_save(FILE *fp, struct directory *directory)
|
||||
directory_save(FILE *fp, const struct directory *directory)
|
||||
{
|
||||
struct dirvec *children = &directory->children;
|
||||
size_t i;
|
||||
|
||||
if (!directory_is_root(directory)) {
|
||||
|
@ -55,8 +54,9 @@ directory_save(FILE *fp, struct directory *directory)
|
|||
directory_get_path(directory));
|
||||
}
|
||||
|
||||
const struct dirvec *children = &directory->children;
|
||||
for (i = 0; i < children->nr; ++i) {
|
||||
struct directory *cur = children->base[i];
|
||||
const struct directory *cur = children->base[i];
|
||||
char *base = g_path_get_basename(cur->path);
|
||||
|
||||
fprintf(fp, DIRECTORY_DIR "%s\n", base);
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
struct directory;
|
||||
|
||||
void
|
||||
directory_save(FILE *fp, struct directory *directory);
|
||||
directory_save(FILE *fp, const struct directory *directory);
|
||||
|
||||
bool
|
||||
directory_load(FILE *fp, struct directory *directory,
|
||||
|
|
Loading…
Reference in New Issue