If chapter separator string is empty or starts with a dash, do not include chapter numbers in file name
Closes #3
This commit is contained in:
parent
a3de8cc162
commit
c996d889e7
|
|
@ -1,3 +1,8 @@
|
|||
0.8.4 / unreleased Fabian Kurz <fabian@fkurz.net>
|
||||
* If chapter separator is empty (-c "") or starts with
|
||||
a dash (-c "-"), do not append a chapter number to filenames
|
||||
(tnx F6FLF)
|
||||
|
||||
0.8.3 / 2020-05-23 Fabian Kurz <fabian@fkurz.net>
|
||||
* Added lowercase Greek alphabet
|
||||
* Added multiple language support by GNU gettext.
|
||||
|
|
|
|||
2
Makefile
2
Makefile
|
|
@ -29,7 +29,7 @@ endif
|
|||
all: ebook2cw
|
||||
|
||||
ebook2cw: ebook2cw.c codetables.h
|
||||
gcc ebook2cw.c -pedantic -Wall -lm $(LDFLAGS) $(CFLAGS) -o ebook2cw
|
||||
gcc ebook2cw.c -pedantic -Wall -Wno-format-truncation -lm $(LDFLAGS) $(CFLAGS) -o ebook2cw
|
||||
msgfmt -o po/de.mo po/de.po
|
||||
|
||||
cgi: ebook2cw.c codetables.h
|
||||
|
|
|
|||
13
ebook2cw.c
13
ebook2cw.c
|
|
@ -401,7 +401,9 @@ cw.encoding = UTF8;
|
|||
|
||||
init_cw(&cw); /* generate raw dit, dah */
|
||||
|
||||
strcat(cw.chapterstr, " ");
|
||||
if (strlen(cw.chapterstr)) {
|
||||
strcat(cw.chapterstr, " ");
|
||||
}
|
||||
|
||||
cw.original_wpm = cw.wpm; /* may be changed by QRQing */
|
||||
chapter = 0;
|
||||
|
|
@ -885,8 +887,15 @@ void openfile (int chapter, CWP *cw) {
|
|||
ogg_packet hdr_code;
|
||||
#endif
|
||||
|
||||
snprintf(cw->outfilename, 80, "%s%04d.%s", cw->chapterfilename, chapter,
|
||||
/* If we have a chapter separator string, use format Chapter0001.mp3 */
|
||||
if (strlen(cw->chapterstr) && cw->chapterstr[0] != '-') {
|
||||
snprintf(cw->outfilename, 80, "%s%04d.%s", cw->chapterfilename,
|
||||
chapter, (cw->encoder == MP3) ? "mp3" : "ogg");
|
||||
}
|
||||
else { /* otherwise just Chapter.mp3 */
|
||||
snprintf(cw->outfilename, 80, "%s.%s", cw->chapterfilename,
|
||||
(cw->encoder == MP3) ? "mp3" : "ogg");
|
||||
}
|
||||
printf(_("Starting %s\n"), cw->outfilename);
|
||||
|
||||
if ((cw->encoder != NOENC) &&
|
||||
|
|
|
|||
Loading…
Reference in New Issue