Fixed bug when using locking and attributes with '/'

SVN revision: 1866
This commit is contained in:
Stefan Ritt 2007-06-12 15:08:48 +00:00
parent 0784d6e607
commit 469ccf0eac

View File

@ -1471,13 +1471,13 @@ void btou(char *str)
/*-------------------------------------------------------------------*/ /*-------------------------------------------------------------------*/
void dtou(char *str) void stou(char *str)
/* convert all dots to underscores in a string */ /* convert all special characters to underscores in a string */
{ {
int i; int i;
for (i = 0; i < (int) strlen(str); i++) for (i = 0; i < (int) strlen(str); i++)
if (str[i] == '.') if (str[i] == ' ' || str[i] == '.' || str[i] == '/' || str[i] == '\\')
str[i] = '_'; str[i] = '_';
} }
@ -8548,7 +8548,7 @@ void attrib_from_param(int n_attr, char attrib[MAX_N_ATTR][NAME_LENGTH])
for (i = 0; i < n_attr; i++) { for (i = 0; i < n_attr; i++) {
strcpy(ua, attr_list[i]); strcpy(ua, attr_list[i]);
btou(ua); stou(ua);
if (attr_flags[i] & (AF_MULTI | AF_MUSERLIST | AF_MUSEREMAIL)) { if (attr_flags[i] & (AF_MULTI | AF_MUSERLIST | AF_MUSEREMAIL)) {
attrib[i][0] = 0; attrib[i][0] = 0;
first = 1; first = 1;
@ -9102,12 +9102,9 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
for (i = 0; i < n_attr; i++) { for (i = 0; i < n_attr; i++) {
if ((attr_flags[i] & AF_REQUIRED)) { if ((attr_flags[i] & AF_REQUIRED)) {
/* convert blanks to underscores */ /* convert blanks etc. to underscores */
strcpy(ua, attr_list[i]); strcpy(ua, attr_list[i]);
btou(ua); stou(ua);
/* convert dots to underscores */
dtou(ua);
if (attr_flags[i] & AF_MULTI) { if (attr_flags[i] & AF_MULTI) {
rsprintf(" if (\n"); rsprintf(" if (\n");
@ -9205,11 +9202,9 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
} }
if (attr_flags[i] & AF_NUMERIC) { if (attr_flags[i] & AF_NUMERIC) {
/* convert blanks to underscores */ /* convert blanks etc. to underscores */
strcpy(ua, attr_list[i]); strcpy(ua, attr_list[i]);
btou(ua); stou(ua);
/* convert dots to underscores */
dtou(ua);
rsprintf(" for (var i=0 ; i<document.form1.%s.value.length ; i++)\n", ua); rsprintf(" for (var i=0 ; i<document.form1.%s.value.length ; i++)\n", ua);
rsprintf(" if (document.form1.%s.value.charAt(i) != \",\" &&\n", ua); rsprintf(" if (document.form1.%s.value.charAt(i) != \",\" &&\n", ua);
@ -9460,8 +9455,7 @@ void show_edit_form(LOGBOOK * lbs, int message_id, BOOL breply, BOOL bedit, BOOL
input_size = 80; input_size = 80;
input_maxlen = NAME_LENGTH; input_maxlen = NAME_LENGTH;
strcpy(ua, attr_list[index]); strcpy(ua, attr_list[index]);
btou(ua); stou(ua);
dtou(ua);
sprintf(str, "Format %s", attr_list[index]); sprintf(str, "Format %s", attr_list[index]);
if (getcfg(lbs->name, str, format, sizeof(format))) { if (getcfg(lbs->name, str, format, sizeof(format))) {
@ -20222,8 +20216,7 @@ void submit_elog(LOGBOOK * lbs)
missing = 0; missing = 0;
for (i = 0; i < lbs->n_attr; i++) { for (i = 0; i < lbs->n_attr; i++) {
strcpy(ua, attr_list[i]); strcpy(ua, attr_list[i]);
btou(ua); stou(ua);
dtou(ua);
if (attr_flags[i] & AF_REQUIRED) { if (attr_flags[i] & AF_REQUIRED) {
if (attr_flags[i] & AF_DATE) { if (attr_flags[i] & AF_DATE) {
@ -20293,8 +20286,7 @@ void submit_elog(LOGBOOK * lbs)
for (index = 0; index < lbs->n_attr; index++) for (index = 0; index < lbs->n_attr; index++)
if (attr_flags[index] & AF_NUMERIC) { if (attr_flags[index] & AF_NUMERIC) {
strcpy(ua, attr_list[index]); strcpy(ua, attr_list[index]);
btou(ua); stou(ua);
dtou(ua);
strlcpy(str, isparam(ua) ? getparam(ua) : "", sizeof(str)); strlcpy(str, isparam(ua) ? getparam(ua) : "", sizeof(str));
for (j = 0; i < (int) strlen(str); i++) for (j = 0; i < (int) strlen(str); i++)
@ -20319,8 +20311,7 @@ void submit_elog(LOGBOOK * lbs)
for (i = 0; i < n_attr; i++) { for (i = 0; i < n_attr; i++) {
strcpy(ua, attr_list[i]); strcpy(ua, attr_list[i]);
btou(ua); stou(ua);
dtou(ua);
if (attr_flags[i] & (AF_MULTI | AF_MUSERLIST | AF_MUSEREMAIL)) if (attr_flags[i] & (AF_MULTI | AF_MUSERLIST | AF_MUSEREMAIL))
strcat(ua, "_0"); strcat(ua, "_0");
@ -20408,8 +20399,7 @@ void submit_elog(LOGBOOK * lbs)
for (i = 0; i < n_attr; i++) { for (i = 0; i < n_attr; i++) {
strcpy(ua, attr_list[i]); strcpy(ua, attr_list[i]);
btou(ua); stou(ua);
dtou(ua);
if (attr_flags[i] & (AF_MULTI | AF_MUSERLIST | AF_MUSEREMAIL)) { if (attr_flags[i] & (AF_MULTI | AF_MUSERLIST | AF_MUSEREMAIL)) {
@ -20683,8 +20673,7 @@ void submit_elog(LOGBOOK * lbs)
for (index = mindex = 0; index <= n_attr; index++) { for (index = mindex = 0; index <= n_attr; index++) {
strcpy(ua, attr_list[index]); strcpy(ua, attr_list[index]);
btou(ua); stou(ua);
dtou(ua);
if (index < n_attr) { if (index < n_attr) {
strcpy(str, "Email "); strcpy(str, "Email ");