File BUGS changed (mode: 100644) (index d9d3da793..dfe07fc4c) |
22 |
22 |
'syscalls' is on, this is some subtle issue, because the code looks fine. |
'syscalls' is on, this is some subtle issue, because the code looks fine. |
23 |
23 |
* Commands starting with a dash don't work in fish shell and maybe some other |
* Commands starting with a dash don't work in fish shell and maybe some other |
24 |
24 |
non-POSIX shells which have `-c` option accept a value. |
non-POSIX shells which have `-c` option accept a value. |
|
25 |
|
* Incrementing/decrementing file names doesn't work as expected for numbers |
|
26 |
|
outside [-2**63; -2**63) range. |
File ChangeLog changed (mode: 100644) (index 852dae55e..58ef90c2f) |
16 |
16 |
Updated .desktop-file to add localizations and be more up-to-date with |
Updated .desktop-file to add localizations and be more up-to-date with |
17 |
17 |
modern recommendations. Patch by Matěj Cepl (a.k.a. mcepl). |
modern recommendations. Patch by Matěj Cepl (a.k.a. mcepl). |
18 |
18 |
|
|
|
19 |
|
Extended range of numbers Ctrl-A/Ctrl-X can deal with from [-2**31; 2**31) |
|
20 |
|
to [-2**63; 2**63). Thanks to CaptainFantastic. |
|
21 |
|
|
19 |
22 |
Fixed 'trashdir' with "%r" on BSD-like systems (those with getmntinfo() |
Fixed 'trashdir' with "%r" on BSD-like systems (those with getmntinfo() |
20 |
23 |
instead of getmntent() API). The regression was apparently introduced in |
instead of getmntent() API). The regression was apparently introduced in |
21 |
24 |
v0.9.1-beta. Thanks to sublimal. |
v0.9.1-beta. Thanks to sublimal. |
File src/fops_rename.c changed (mode: 100644) (index 2ff68ab51..4c08e82e2) |
... |
... |
incdec_name(const char fname[], int k) |
600 |
600 |
static char result[NAME_MAX + 1]; |
static char result[NAME_MAX + 1]; |
601 |
601 |
char format[16]; |
char format[16]; |
602 |
602 |
char *b, *e; |
char *b, *e; |
603 |
|
int i, n; |
|
|
603 |
|
int n; |
604 |
604 |
|
|
605 |
605 |
b = strpbrk(fname, "0123456789"); |
b = strpbrk(fname, "0123456789"); |
606 |
606 |
if(b == NULL) |
if(b == NULL) |
|
... |
... |
incdec_name(const char fname[], int k) |
620 |
620 |
--b; |
--b; |
621 |
621 |
} |
} |
622 |
622 |
|
|
623 |
|
i = strtol(b, &e, 10); |
|
|
623 |
|
long long i = strtoll(b, &e, 10); |
624 |
624 |
|
|
625 |
625 |
if(i + k < 0) |
if(i + k < 0) |
626 |
626 |
{ |
{ |
|
... |
... |
incdec_name(const char fname[], int k) |
628 |
628 |
} |
} |
629 |
629 |
|
|
630 |
630 |
copy_str(result, b - fname + 1, fname); |
copy_str(result, b - fname + 1, fname); |
631 |
|
snprintf(format, sizeof(format), "%%0%dd%%s", n + count_digits(i)); |
|
|
631 |
|
snprintf(format, sizeof(format), "%%0%dlld%%s", n + count_digits(i)); |
632 |
632 |
snprintf(result + (b - fname), sizeof(result) - (b - fname), format, i + k, |
snprintf(result + (b - fname), sizeof(result) - (b - fname), format, i + k, |
633 |
633 |
e); |
e); |
634 |
634 |
|
|
File tests/misc/rename.c changed (mode: 100644) (index e4d5260b7..109c89492) |
... |
... |
TEST(incdec_leaves_zeros) |
190 |
190 |
assert_string_equal("a01.", incdec_name("a00.", 1)); |
assert_string_equal("a01.", incdec_name("a00.", 1)); |
191 |
191 |
} |
} |
192 |
192 |
|
|
|
193 |
|
TEST(incdec_handles_large_numbers) |
|
194 |
|
{ |
|
195 |
|
/* 2**31-1 / 2**31 / 2**31+1 */ |
|
196 |
|
assert_string_equal("2147483648", incdec_name("2147483647", 1)); |
|
197 |
|
assert_string_equal("2147483649", incdec_name("2147483648", 1)); |
|
198 |
|
assert_string_equal("2147483650", incdec_name("2147483649", 1)); |
|
199 |
|
|
|
200 |
|
/* 2**32-1 / 2**32 / 2**32+1 */ |
|
201 |
|
assert_string_equal("4294967296", incdec_name("4294967295", 1)); |
|
202 |
|
assert_string_equal("4294967297", incdec_name("4294967296", 1)); |
|
203 |
|
assert_string_equal("4294967298", incdec_name("4294967297", 1)); |
|
204 |
|
} |
|
205 |
|
|
193 |
206 |
TEST(single_file_rename) |
TEST(single_file_rename) |
194 |
207 |
{ |
{ |
195 |
208 |
char *error = NULL; |
char *error = NULL; |