Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Web update: ensure that the patch pool directory exists

  • Loading branch information...
commit b1adfb379ca9f2e4e5515cbae19a3f827fe52b22 1 parent 0f0f134
@sbourdeauducq sbourdeauducq authored
View
2  src/flash.c
@@ -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++;
}
View
3  src/keyboard.c
@@ -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, '.');
View
7 src/midi.c
@@ -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, '.');
@@ -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");
@@ -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();
}
View
3  src/oscsettings.c
@@ -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, '.');
View
2  src/performance.c
@@ -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)) {
View
2  src/performance.h
@@ -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();
Please sign in to comment.
Something went wrong with that request. Please try again.