mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-10 18:23:28 +00:00
Fixed problem with empty bottom text
SVN revision: 1603
This commit is contained in:
parent
1b8c197a51
commit
b1b9e71797
44
src/elogd.c
44
src/elogd.c
@ -7016,28 +7016,30 @@ void show_bottom_text(LOGBOOK * lbs)
|
|||||||
FILE *f;
|
FILE *f;
|
||||||
char file_name[256], *buf;
|
char file_name[256], *buf;
|
||||||
|
|
||||||
/* check if file starts with an absolute directory */
|
if (str[0]) {
|
||||||
if (str[0] == DIR_SEPARATOR || str[1] == ':')
|
/* check if file starts with an absolute directory */
|
||||||
strcpy(file_name, str);
|
if (str[0] == DIR_SEPARATOR || str[1] == ':')
|
||||||
else {
|
strcpy(file_name, str);
|
||||||
strlcpy(file_name, resource_dir, sizeof(file_name));
|
else {
|
||||||
strlcat(file_name, str, sizeof(file_name));
|
strlcpy(file_name, resource_dir, sizeof(file_name));
|
||||||
|
strlcat(file_name, str, sizeof(file_name));
|
||||||
|
}
|
||||||
|
|
||||||
|
f = fopen(file_name, "rb");
|
||||||
|
if (f != NULL) {
|
||||||
|
fseek(f, 0, SEEK_END);
|
||||||
|
size = TELL(fileno(f));
|
||||||
|
fseek(f, 0, SEEK_SET);
|
||||||
|
|
||||||
|
buf = xmalloc(size + 1);
|
||||||
|
fread(buf, 1, size, f);
|
||||||
|
buf[size] = 0;
|
||||||
|
fclose(f);
|
||||||
|
|
||||||
|
rsputs(buf);
|
||||||
|
} else
|
||||||
|
rsputs(str);
|
||||||
}
|
}
|
||||||
|
|
||||||
f = fopen(file_name, "rb");
|
|
||||||
if (f != NULL) {
|
|
||||||
fseek(f, 0, SEEK_END);
|
|
||||||
size = TELL(fileno(f));
|
|
||||||
fseek(f, 0, SEEK_SET);
|
|
||||||
|
|
||||||
buf = xmalloc(size + 1);
|
|
||||||
fread(buf, 1, size, f);
|
|
||||||
buf[size] = 0;
|
|
||||||
fclose(f);
|
|
||||||
|
|
||||||
rsputs(buf);
|
|
||||||
} else
|
|
||||||
rsputs(str);
|
|
||||||
} else
|
} else
|
||||||
/* add little logo */
|
/* add little logo */
|
||||||
rsprintf
|
rsprintf
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user