Skip to content

Commit

Permalink
Web update: ensure that the patch pool directory exists
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastien Bourdeauducq committed Jul 3, 2011
1 parent 0f0f134 commit b1adfb3
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/flash.c
Expand Up @@ -472,7 +472,7 @@ static void download_patches(struct patchpool *pp)
encoded = curl_author_needs_to_take_a_dump(pp->names[i]);
snprintf(url, sizeof(url), BASE_URL "patches/%s", encoded);
free(encoded);
snprintf(target, sizeof(target), SIMPLE_PATCHES_FOLDER "%s", pp->names[i]);
snprintf(target, sizeof(target), SIMPLE_PATCHES_FOLDER "/%s", pp->names[i]);
download(url, target, 0);
done++;
}
Expand Down
3 changes: 1 addition & 2 deletions src/keyboard.c
Expand Up @@ -193,8 +193,7 @@ static void autobuild(int sk, char *folder)
n_files = 0;
while((entry = readdir(d))) {
if(entry->d_name[0] == '.') continue;
strncpy(fullname, folder, sizeof(fullname));
strncat(fullname, entry->d_name, sizeof(fullname));
snprintf(fullname, sizeof(fullname), "%s/%s", folder, entry->d_name);
lstat(fullname, &s);
if(!S_ISDIR(s.st_mode)) {
c = strrchr(entry->d_name, '.');
Expand Down
7 changes: 5 additions & 2 deletions src/midi.c
Expand Up @@ -372,8 +372,7 @@ static void autobuild(int sn, char *folder)
n_files = 0;
while((entry = readdir(d))) {
if(entry->d_name[0] == '.') continue;
strncpy(fullname, folder, sizeof(fullname));
strncat(fullname, entry->d_name, sizeof(fullname));
snprintf(fullname, sizeof(fullname), "%s/%s", folder, entry->d_name);
lstat(fullname, &s);
if(!S_ISDIR(s.st_mode)) {
c = strrchr(entry->d_name, '.');
Expand All @@ -400,6 +399,7 @@ static void autobuild_callback(mtk_event *e, void *arg)
char note[8];
int notecode;
char filename[384];
int i;

mtk_req(appid, note, sizeof(note), "e_note.text");
mtk_req(appid, filename, sizeof(filename), "e_filename.text");
Expand All @@ -412,6 +412,9 @@ static void autobuild_callback(mtk_event *e, void *arg)
messagebox("Auto build failed", "Invalid starting note");
return;
}
i = strlen(filename);
if(filename[i-1] == '/')
filename[i-1] = 0x00;
autobuild(notecode, filename);
update_list();
}
Expand Down
3 changes: 1 addition & 2 deletions src/oscsettings.c
Expand Up @@ -196,8 +196,7 @@ static void autobuild(int si, char *folder)
n_files = 0;
while((entry = readdir(d))) {
if(entry->d_name[0] == '.') continue;
strncpy(fullname, folder, sizeof(fullname));
strncat(fullname, entry->d_name, sizeof(fullname));
snprintf(fullname, sizeof(fullname), "%s/%s", folder, entry->d_name);
lstat(fullname, &s);
if(!S_ISDIR(s.st_mode)) {
c = strrchr(entry->d_name, '.');
Expand Down
2 changes: 1 addition & 1 deletion src/performance.c
Expand Up @@ -159,7 +159,7 @@ static void add_simple_patches()
return;
while((entry = readdir(d))) {
if(entry->d_name[0] == '.') continue;
strncpy(fullname, SIMPLE_PATCHES_FOLDER, sizeof(fullname));
strncpy(fullname, SIMPLE_PATCHES_FOLDER"/", sizeof(fullname));
strncat(fullname, entry->d_name, sizeof(fullname));
lstat(fullname, &s);
if(!S_ISDIR(s.st_mode)) {
Expand Down
2 changes: 1 addition & 1 deletion src/performance.h
Expand Up @@ -18,7 +18,7 @@
#ifndef __PERFORMANCE_H
#define __PERFORMANCE_H

#define SIMPLE_PATCHES_FOLDER "/ssd/patchpool/"
#define SIMPLE_PATCHES_FOLDER "/ssd/patchpool"

void init_performance();
void open_performance_window();
Expand Down

0 comments on commit b1adfb3

Please sign in to comment.