mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-12 19:33:03 +00:00
Fixed issue with quotes under linux
SVN revision: 2023
This commit is contained in:
parent
33179aa33a
commit
23e8f51537
18
src/elogd.c
18
src/elogd.c
@ -22027,7 +22027,7 @@ int is_inline_attachment(char *encoding, int message_id, char *text, int i, char
|
|||||||
|
|
||||||
int create_thumbnail(LOGBOOK * lbs, char *file_name)
|
int create_thumbnail(LOGBOOK * lbs, char *file_name)
|
||||||
{
|
{
|
||||||
char str[MAX_PATH_LENGTH], str2[MAX_PATH_LENGTH], cmd[2*MAX_PATH_LENGTH], thumb_size[256];
|
char str[MAX_PATH_LENGTH], cmd[2*MAX_PATH_LENGTH], thumb_size[256];
|
||||||
|
|
||||||
if (!getcfg(lbs->name, "Thumbnail size", thumb_size, sizeof(thumb_size)))
|
if (!getcfg(lbs->name, "Thumbnail size", thumb_size, sizeof(thumb_size)))
|
||||||
return 0;
|
return 0;
|
||||||
@ -22052,8 +22052,6 @@ int create_thumbnail(LOGBOOK * lbs, char *file_name)
|
|||||||
strlcat(str, ".png", sizeof(str));
|
strlcat(str, ".png", sizeof(str));
|
||||||
if (file_exist(str))
|
if (file_exist(str))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
strlcpy(str2, file_name, sizeof(str2));
|
|
||||||
} else {
|
} else {
|
||||||
strlcpy(str, file_name, sizeof(str));
|
strlcpy(str, file_name, sizeof(str));
|
||||||
strlcat(str, "-0.png", sizeof(str));
|
strlcat(str, "-0.png", sizeof(str));
|
||||||
@ -22064,22 +22062,18 @@ int create_thumbnail(LOGBOOK * lbs, char *file_name)
|
|||||||
strlcat(str, ".png", sizeof(str));
|
strlcat(str, ".png", sizeof(str));
|
||||||
if (file_exist(str))
|
if (file_exist(str))
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
strlcpy(str2, file_name, sizeof(str2));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef OS_UNIX
|
#ifdef OS_UNIX
|
||||||
strsubst(str2, sizeof(str2), " ", "\\ ");
|
|
||||||
strsubst(str, sizeof(str), " ", "\\ ");
|
|
||||||
if (chkext(file_name, ".pdf") || chkext(file_name, ".ps"))
|
if (chkext(file_name, ".pdf") || chkext(file_name, ".ps"))
|
||||||
sprintf(cmd, "convert '%s[0-7]' -thumbnail '%s' '%s'", str2, thumb_size, str);
|
sprintf(cmd, "convert '%s[0-7]' -thumbnail '%s' '%s'", file_name, thumb_size, str);
|
||||||
else
|
else
|
||||||
sprintf(cmd, "convert '%s' -thumbnail '%s' '%s'", str2, thumb_size, str);
|
sprintf(cmd, "convert '%s' -thumbnail '%s' '%s'", file_name, thumb_size, str);
|
||||||
#else
|
#else
|
||||||
if (chkext(file_name, ".pdf") || chkext(file_name, ".ps"))
|
if (chkext(file_name, ".pdf") || chkext(file_name, ".ps"))
|
||||||
sprintf(cmd, "convert \"%s[0-7]\" -thumbnail \"%s\" \"%s\"", str2, thumb_size, str);
|
sprintf(cmd, "convert \"%s[0-7]\" -thumbnail \"%s\" \"%s\"", file_name, thumb_size, str);
|
||||||
else
|
else
|
||||||
sprintf(cmd, "convert \"%s\" -thumbnail \"%s\" \"%s\"", str2, thumb_size, str);
|
sprintf(cmd, "convert \"%s\" -thumbnail \"%s\" \"%s\"", file_name, thumb_size, str);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
sprintf(str, "SHELL \"%s\"", cmd);
|
sprintf(str, "SHELL \"%s\"", cmd);
|
||||||
@ -23101,7 +23095,7 @@ void show_elog_entry(LOGBOOK * lbs, char *dec_path, char *command)
|
|||||||
if (!email) {
|
if (!email) {
|
||||||
rsprintf("<a name=\"att%d\" href=\"%s\">\n", index + 1, ref);
|
rsprintf("<a name=\"att%d\" href=\"%s\">\n", index + 1, ref);
|
||||||
strlcpy(str, ref, sizeof(str));
|
strlcpy(str, ref, sizeof(str));
|
||||||
if (chkext(str, ".pdf"))
|
if (chkext(file_name, ".pdf") || chkext(file_name, ".ps") | chkext(file_name, ".eps"))
|
||||||
if (strrchr(str, '.'))
|
if (strrchr(str, '.'))
|
||||||
*strrchr(str, '.') = 0;
|
*strrchr(str, '.') = 0;
|
||||||
strlcat(str, ".png", sizeof(str));
|
strlcat(str, ".png", sizeof(str));
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user