summaryrefslogtreecommitdiff
path: root/ext/date/date_core.c
diff options
context:
space:
mode:
authorDmitrii Zudin <[email protected]>2024-09-21 23:37:07 +0300
committergit <[email protected]>2024-11-05 03:38:13 +0000
commitee4599dbe7e49a242a1e8170b0439cfb0130ad98 (patch)
treef984017e48902a80ef2f644115a5e556712121cc /ext/date/date_core.c
parente0611ebd9a4c05a9c16a1da8e5c3081f7890ea8c (diff)
[ruby/date] Fix incorrect argc2 decrement in datetime_s_iso8601 function
Replace the decrement (argc2--) with an increment (argc2++) for the correct number of arguments when opt is provided. https://github.com/ruby/date/commit/b6974b00d8
Diffstat (limited to 'ext/date/date_core.c')
-rw-r--r--ext/date/date_core.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/date/date_core.c b/ext/date/date_core.c
index 823c0bc2a5..5d9fe4ff98 100644
--- a/ext/date/date_core.c
+++ b/ext/date/date_core.c
@@ -8485,7 +8485,7 @@ datetime_s_iso8601(int argc, VALUE *argv, VALUE klass)
VALUE argv2[2], hash;
argv2[0] = str;
argv2[1] = opt;
- if (!NIL_P(opt)) argc2--;
+ if (!NIL_P(opt)) argc2++;
hash = date_s__iso8601(argc2, argv2, klass);
return dt_new_by_frags(klass, hash, sg);
}