salesforce_id 1.3.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ext/salesforce_id/salesforce_id_ext.c +8 -6
- data/lib/salesforce_id/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 7a94596d9208f6008265abde3708587189ffb7d3
|
|
4
|
+
data.tar.gz: 854f459fede1722c890bf4d51add07fadfcf11de
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2a0f58f1dc2381d15116686156b0b18c9e90604af210fabfb9fe745ede206caa6b0bb81b9381abbbdfbbea9d863953529208bd899d4d3513f4b097a1b8257d30
|
|
7
|
+
data.tar.gz: bd7b86ed46c468281ad28d4f38caf9f384705cc40c5801945578b7770adc450f149f4cc8b4ebdfc3a091e75430175c35889c9e33e24ba3096e5a4d4cfee5971c
|
|
@@ -115,18 +115,20 @@ VALUE salesforce_id_is_valid(VALUE self, VALUE rb_sId)
|
|
|
115
115
|
|
|
116
116
|
VALUE salesforce_insensitive_repair_casing(VALUE self, VALUE rb_sId)
|
|
117
117
|
{
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
if (!is_id_valid(id) || RSTRING_LEN(id) != SALESFORCE_ID_INSENSITIVE_LENGTH)
|
|
121
|
-
rb_raise(rb_eArgError, "Salesforce ID is not case-insensitive format");
|
|
122
|
-
|
|
118
|
+
VALUE id = Qnil;
|
|
123
119
|
// Start for insensitive characters
|
|
124
120
|
const size_t istart = (size_t)SALESFORCE_ID_SENSITIVE_LENGTH;
|
|
125
121
|
const size_t sensitive_chars = 3u;
|
|
126
122
|
const int new_id_size = SALESFORCE_ID_INSENSITIVE_STRING_LENGTH;
|
|
127
|
-
char* old_id =
|
|
123
|
+
char* old_id = NULL;
|
|
128
124
|
char new_id[SALESFORCE_ID_INSENSITIVE_STRING_LENGTH] = {0};
|
|
129
125
|
|
|
126
|
+
id = rb_obj_as_string(rb_sId);
|
|
127
|
+
old_id = StringValueCStr(id);
|
|
128
|
+
|
|
129
|
+
if (!is_id_valid(id) || RSTRING_LEN(id) != SALESFORCE_ID_INSENSITIVE_LENGTH)
|
|
130
|
+
rb_raise(rb_eArgError, "Salesforce ID is not case-insensitive format");
|
|
131
|
+
|
|
130
132
|
memcpy(new_id, old_id, new_id_size);
|
|
131
133
|
repair_casing(new_id);
|
|
132
134
|
memcpy(&new_id[istart], &old_id[istart], sizeof(new_id[0]) * sensitive_chars);
|