mirror of
https://gitea.psi.ch/ELOG/elog.git
synced 2026-09-14 20:33:48 +00:00
Allow empty text for logbooks without text
This commit is contained in:
parent
12a9c5c0c5
commit
8196b8171c
19
src/elog.c
19
src/elog.c
@ -801,9 +801,10 @@ INT submit_elog(char *host, int port, int ssl, char *subdir, char *experiment,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
sprintf(content + strlen(content),
|
if (text[0])
|
||||||
"%s\r\nContent-Disposition: form-data; name=\"Text\"\r\n\r\n%s\r\n%s\r\n",
|
sprintf(content + strlen(content),
|
||||||
boundary, text, boundary);
|
"%s\r\nContent-Disposition: form-data; name=\"Text\"\r\n\r\n%s\r\n%s\r\n",
|
||||||
|
boundary, text, boundary);
|
||||||
|
|
||||||
content_length = strlen(content);
|
content_length = strlen(content);
|
||||||
p = content + content_length;
|
p = content + content_length;
|
||||||
@ -978,7 +979,8 @@ int main(int argc, char *argv[])
|
|||||||
char host_name[256], logbook[32], textfile[256], subdir[256];
|
char host_name[256], logbook[32], textfile[256], subdir[256];
|
||||||
char *buffer[MAX_ATTACHMENTS], attachment[MAX_ATTACHMENTS][256];
|
char *buffer[MAX_ATTACHMENTS], attachment[MAX_ATTACHMENTS][256];
|
||||||
INT att_size[MAX_ATTACHMENTS];
|
INT att_size[MAX_ATTACHMENTS];
|
||||||
INT i, n, fh, n_att, n_attr, port, reply, quote_on_reply, edit, download, encoding, suppress, size, ssl;
|
INT i, n, fh, n_att, n_attr, port, reply, quote_on_reply, edit, download, encoding, suppress, size, ssl,
|
||||||
|
text_flag;
|
||||||
char attr_name[MAX_N_ATTR][NAME_LENGTH], attrib[MAX_N_ATTR][NAME_LENGTH];
|
char attr_name[MAX_N_ATTR][NAME_LENGTH], attrib[MAX_N_ATTR][NAME_LENGTH];
|
||||||
|
|
||||||
text[0] = textfile[0] = uname[0] = upwd[0] = suppress = quote_on_reply = 0;
|
text[0] = textfile[0] = uname[0] = upwd[0] = suppress = quote_on_reply = 0;
|
||||||
@ -986,6 +988,7 @@ int main(int argc, char *argv[])
|
|||||||
n_att = n_attr = reply = edit = download = encoding = 0;
|
n_att = n_attr = reply = edit = download = encoding = 0;
|
||||||
port = 80;
|
port = 80;
|
||||||
ssl = 0;
|
ssl = 0;
|
||||||
|
text_flag = 0;
|
||||||
|
|
||||||
for (i = 0; i < MAX_ATTACHMENTS; i++) {
|
for (i = 0; i < MAX_ATTACHMENTS; i++) {
|
||||||
attachment[i][0] = 0;
|
attachment[i][0] = 0;
|
||||||
@ -1042,9 +1045,10 @@ int main(int argc, char *argv[])
|
|||||||
download = atoi(argv[++i]);
|
download = atoi(argv[++i]);
|
||||||
} else if (argv[i][1] == 'n')
|
} else if (argv[i][1] == 'n')
|
||||||
encoding = atoi(argv[++i]);
|
encoding = atoi(argv[++i]);
|
||||||
else if (argv[i][1] == 'm')
|
else if (argv[i][1] == 'm') {
|
||||||
strcpy(textfile, argv[++i]);
|
strcpy(textfile, argv[++i]);
|
||||||
else {
|
text_flag = 1;
|
||||||
|
} else {
|
||||||
usage:
|
usage:
|
||||||
printf("%s ", ELOGID);
|
printf("%s ", ELOGID);
|
||||||
strcpy(str, svn_revision + 13);
|
strcpy(str, svn_revision + 13);
|
||||||
@ -1076,6 +1080,7 @@ int main(int argc, char *argv[])
|
|||||||
} else {
|
} else {
|
||||||
strcpy(text, argv[i]);
|
strcpy(text, argv[i]);
|
||||||
convert_crlf(text, sizeof(text));
|
convert_crlf(text, sizeof(text));
|
||||||
|
text_flag = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1139,7 +1144,7 @@ int main(int argc, char *argv[])
|
|||||||
close(fh);
|
close(fh);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (text[0] == 0 && textfile[0] == 0 && !edit && !download) {
|
if (text_flag == 0 && !edit && !download) {
|
||||||
/* read from stdin */
|
/* read from stdin */
|
||||||
|
|
||||||
n = 0;
|
n = 0;
|
||||||
|
|||||||
@ -93,7 +93,7 @@
|
|||||||
D52BA2F113999DB0000458E3 /* Project object */ = {
|
D52BA2F113999DB0000458E3 /* Project object */ = {
|
||||||
isa = PBXProject;
|
isa = PBXProject;
|
||||||
attributes = {
|
attributes = {
|
||||||
LastUpgradeCheck = 0610;
|
LastUpgradeCheck = 0630;
|
||||||
ORGANIZATIONNAME = PSI;
|
ORGANIZATIONNAME = PSI;
|
||||||
};
|
};
|
||||||
buildConfigurationList = D52BA2F413999DB0000458E3 /* Build configuration list for PBXProject "elog" */;
|
buildConfigurationList = D52BA2F413999DB0000458E3 /* Build configuration list for PBXProject "elog" */;
|
||||||
@ -138,6 +138,7 @@
|
|||||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||||
|
GCC_NO_COMMON_BLOCKS = YES;
|
||||||
GCC_OPTIMIZATION_LEVEL = 0;
|
GCC_OPTIMIZATION_LEVEL = 0;
|
||||||
GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
|
GCC_PREPROCESSOR_DEFINITIONS = DEBUG;
|
||||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||||
@ -166,6 +167,7 @@
|
|||||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
|
||||||
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
ENABLE_STRICT_OBJC_MSGSEND = YES;
|
||||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||||
|
GCC_NO_COMMON_BLOCKS = YES;
|
||||||
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
|
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
|
||||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
|
||||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user