summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 562389c)
raw | patch | inline | side by side (parent: 562389c)
author | Jonathan Neuschäfer <j.neuschaefer@gmx.net> | |
Sat, 3 Apr 2010 19:35:34 +0000 (21:35 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Mon, 5 Apr 2010 17:05:00 +0000 (19:05 +0200) |
src/screen_lyrics.c | patch | blob | history |
diff --git a/src/screen_lyrics.c b/src/screen_lyrics.c
index ba197a04c22a54905f3eba51fd217662aa62c3e3..6cb7b46efddf71590f40d010936a701f18b80d46 100644 (file)
--- a/src/screen_lyrics.c
+++ b/src/screen_lyrics.c
}
}
+static void
+path_lyr_file(char *path, size_t size,
+ const char *artist, const char *title)
+{
+ snprintf(path, size, "%s/.lyrics/%s - %s.txt",
+ getenv("HOME"), artist, title);
+}
+
static bool
exists_lyr_file(const char *artist, const char *title)
{
char path[1024];
struct stat result;
- snprintf(path, 1024, "%s/.lyrics/%s - %s.txt",
- getenv("HOME"), artist, title);
+ path_lyr_file(path, 1024, artist, title);
return (stat(path, &result) == 0);
}
getenv("HOME"));
mkdir(path, S_IRWXU);
- snprintf(path, 1024, "%s/.lyrics/%s - %s.txt",
- getenv("HOME"), artist, title);
+ path_lyr_file(path, 1024, artist, title);
return fopen(path, "w");
}