Commit 64f8502
mv: replace src_dir with a strvec
We manually manage the src_dir array with ALLOC_GROW. Using a strvec is
a little more ergonomic, and makes the memory ownership more clear. It
does mean that we copy the strings (which were otherwise just pointers
into the "sources" strvec), but using the same rationale as 9fcd9e4
(builtin/mv duplicate string list memory, 2024-05-27), it's just not
enough to be worth worrying about here.
As a bonus, this gets rid of some "int"s used for allocation management
(though in practice these were limited to command-line sizes and thus
not overflowable).
Signed-off-by: Jeff King <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>1 parent d58a687 commit 64f8502
1 file changed
+4
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
200 | | - | |
201 | | - | |
| 200 | + | |
202 | 201 | | |
203 | 202 | | |
204 | 203 | | |
| |||
344 | 343 | | |
345 | 344 | | |
346 | 345 | | |
347 | | - | |
348 | | - | |
| 346 | + | |
349 | 347 | | |
350 | 348 | | |
351 | 349 | | |
| |||
559 | 557 | | |
560 | 558 | | |
561 | 559 | | |
562 | | - | |
| 560 | + | |
563 | 561 | | |
564 | 562 | | |
565 | 563 | | |
| |||
574 | 572 | | |
575 | 573 | | |
576 | 574 | | |
577 | | - | |
| 575 | + | |
578 | 576 | | |
579 | 577 | | |
580 | 578 | | |
| |||
0 commit comments