Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit a6b4c64

Browse files
author
runrevali
committed
[[ Bug 12104 ]] Convert command fails with invalid date
1 parent dddbc06 commit a6b4c64

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

docs/notes/bugfix-12104.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Convert command fails with invalid date since 7.0

engine/src/date.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1094,8 +1094,8 @@ bool MCD_convert_to_datetime(MCExecContext &ctxt, MCValueRef p_input, Convert_fo
10941094
return false;
10951095
}
10961096

1097-
1098-
if (!MCValueIsEmpty(p_input))
1097+
// AL-2014-03-04: [[ Bug 12104 ]] If we have more to parse here, then parsing failed.
1098+
if (MCStringGetLength(*t_string) > t_offset)
10991099
return false;
11001100

11011101
if ((t_valid_dateitems & DATETIME_ITEM_DATE) != DATETIME_ITEM_DATE)
@@ -1312,7 +1312,8 @@ bool MCD_convert_from_datetime(MCExecContext &ctxt, MCDateTime p_datetime, Conve
13121312
t_buffer = t_new;
13131313
}
13141314

1315-
ctxt.SetTheResultToValue(t_buffer);
1315+
// AL-2014-03-04: [[ Bug 12104 ]] The result should be empty if conversion is successful.
1316+
//ctxt.SetTheResultToValue(t_buffer);
13161317
r_output = t_buffer;
13171318
}
13181319

0 commit comments

Comments
 (0)