mirror of
https://github.com/amadvance/snapraid.git
synced 2026-11-26 01:46:32 -05:00
Adds missing / in mount point specification
Adds example configuration file
This commit is contained in:
parent
496971e9c9
commit
7c64ee26f9
7 changed files with 51 additions and 27 deletions
13
elem.c
13
elem.c
|
|
@ -96,6 +96,19 @@ struct snapraid_disk* disk_alloc(const char* name, const char* dir)
|
|||
disk = malloc_nofail(sizeof(struct snapraid_disk));
|
||||
snprintf(disk->name, sizeof(disk->name), "%s", name);
|
||||
snprintf(disk->dir, sizeof(disk->dir), "%s", dir);
|
||||
|
||||
/* ensure that the dir terminate with "/" if it isn't empty */
|
||||
if (disk->dir[0] != 0) {
|
||||
char last = disk->dir[strlen(disk->dir) - 1];
|
||||
if (last != '/'
|
||||
#ifdef _WIN32
|
||||
&& last != '\\'
|
||||
#endif
|
||||
) {
|
||||
snprintf(disk->dir, sizeof(disk->dir), "%s/", dir);
|
||||
}
|
||||
}
|
||||
|
||||
disk->first_free_block = 0;
|
||||
tommy_list_init(&disk->filelist);
|
||||
tommy_hashdyn_init(&disk->fileset);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue