Commit e51e29e
committed
config_parse: have
The function `git_config_parse` uses several callbacks to pass data
along to the caller as it parses the file. One design shortcoming here
is that strings passed to those callbacks are expected to be freed by
them, which is really confusing.
Fix the issue by changing memory ownership here. Instead of expecting
the `on_variable` callbacks to free memory for `git_config_parse`, just
do it inside of `git_config_parse`. While this obviously requires a bit
more memory allocation churn due to having to copy both name and value
at some places, this shouldn't be too much of a burden.git_config_parse own entry value and name1 parent e212011 commit e51e29e
3 files changed
+17
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1022 | 1022 | | |
1023 | 1023 | | |
1024 | 1024 | | |
1025 | | - | |
1026 | | - | |
| 1025 | + | |
| 1026 | + | |
1027 | 1027 | | |
1028 | 1028 | | |
1029 | 1029 | | |
1030 | 1030 | | |
1031 | 1031 | | |
1032 | 1032 | | |
1033 | 1033 | | |
| 1034 | + | |
1034 | 1035 | | |
1035 | 1036 | | |
1036 | 1037 | | |
1037 | 1038 | | |
1038 | 1039 | | |
1039 | | - | |
1040 | | - | |
1041 | | - | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
1042 | 1044 | | |
1043 | 1045 | | |
1044 | | - | |
| 1046 | + | |
1045 | 1047 | | |
1046 | 1048 | | |
1047 | 1049 | | |
1048 | 1050 | | |
1049 | 1051 | | |
1050 | 1052 | | |
1051 | | - | |
| 1053 | + | |
1052 | 1054 | | |
1053 | 1055 | | |
1054 | 1056 | | |
| |||
1065 | 1067 | | |
1066 | 1068 | | |
1067 | 1069 | | |
1068 | | - | |
1069 | 1070 | | |
1070 | 1071 | | |
1071 | 1072 | | |
| |||
1249 | 1250 | | |
1250 | 1251 | | |
1251 | 1252 | | |
1252 | | - | |
1253 | | - | |
| 1253 | + | |
| 1254 | + | |
1254 | 1255 | | |
1255 | 1256 | | |
1256 | 1257 | | |
| |||
1279 | 1280 | | |
1280 | 1281 | | |
1281 | 1282 | | |
1282 | | - | |
1283 | | - | |
1284 | | - | |
1285 | 1283 | | |
1286 | 1284 | | |
1287 | 1285 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
463 | 463 | | |
464 | 464 | | |
465 | 465 | | |
466 | | - | |
| 466 | + | |
467 | 467 | | |
468 | 468 | | |
469 | 469 | | |
| |||
508 | 508 | | |
509 | 509 | | |
510 | 510 | | |
| 511 | + | |
| 512 | + | |
511 | 513 | | |
| 514 | + | |
512 | 515 | | |
513 | 516 | | |
514 | 517 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
39 | | - | |
40 | | - | |
| 39 | + | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| |||
0 commit comments