| File src/cfg/info.c changed (mode: 100644) (index 56d338b46..145f85d85) |
| ... |
... |
read_legacy_info_file(const char info_file[]) |
| 588 |
588 |
} |
} |
| 589 |
589 |
else if(type == LINE_TYPE_REG) |
else if(type == LINE_TYPE_REG) |
| 590 |
590 |
{ |
{ |
| 591 |
|
char *pos = strchr(valid_registers, line_val[0]); |
|
|
591 |
|
const char *pos = strchr(valid_registers, line_val[0]); |
| 592 |
592 |
if(pos != NULL) |
if(pos != NULL) |
| 593 |
593 |
{ |
{ |
| 594 |
594 |
char name[] = { line_val[0], '\0' }; |
char name[] = { line_val[0], '\0' }; |
| File src/cmd_completion.c changed (mode: 100644) (index cbaf1ad4c..f0df55363) |
| ... |
... |
static int |
| 714 |
714 |
complete_chown(const char *str) |
complete_chown(const char *str) |
| 715 |
715 |
{ |
{ |
| 716 |
716 |
#ifndef _WIN32 |
#ifndef _WIN32 |
| 717 |
|
char *colon = strchr(str, ':'); |
|
|
717 |
|
const char *colon = strchr(str, ':'); |
| 718 |
718 |
if(colon == NULL) |
if(colon == NULL) |
| 719 |
719 |
{ |
{ |
| 720 |
720 |
complete_user_name(str); |
complete_user_name(str); |
| 721 |
721 |
return 0; |
return 0; |
| 722 |
722 |
} |
} |
| 723 |
|
else |
|
| 724 |
|
{ |
|
| 725 |
|
complete_group_name(colon + 1); |
|
| 726 |
|
return colon - str + 1; |
|
| 727 |
|
} |
|
|
723 |
|
|
|
724 |
|
complete_group_name(colon + 1); |
|
725 |
|
return colon - str + 1; |
| 728 |
726 |
#else |
#else |
| 729 |
727 |
vle_compl_add_last_match(str); |
vle_compl_add_last_match(str); |
| 730 |
728 |
return 0; |
return 0; |
| File src/filename_modifiers.c changed (mode: 100644) (index 104333727..e9b6f0cc4) |
| ... |
... |
apply_dot_mod(const char *path, char *buf, size_t buf_len) |
| 181 |
181 |
static int |
static int |
| 182 |
182 |
apply_h_mod(const char *path, char *buf, size_t buf_len) |
apply_h_mod(const char *path, char *buf, size_t buf_len) |
| 183 |
183 |
{ |
{ |
| 184 |
|
char *p = strrchr(path, '/'); |
|
|
184 |
|
const char *p = strrchr(path, '/'); |
| 185 |
185 |
if(p == NULL) |
if(p == NULL) |
| 186 |
186 |
{ |
{ |
| 187 |
187 |
snprintf(buf, buf_len, "."); |
snprintf(buf, buf_len, "."); |
| |
| ... |
... |
apply_u_mod(const char *path, char *buf, size_t buf_len) |
| 221 |
221 |
static int |
static int |
| 222 |
222 |
apply_t_mod(const char *path, char *buf, size_t buf_len) |
apply_t_mod(const char *path, char *buf, size_t buf_len) |
| 223 |
223 |
{ |
{ |
| 224 |
|
char *p = strrchr(path, '/'); |
|
|
224 |
|
const char *p = strrchr(path, '/'); |
| 225 |
225 |
copy_str(buf, buf_len, (p == NULL) ? path : (p + 1)); |
copy_str(buf, buf_len, (p == NULL) ? path : (p + 1)); |
| 226 |
226 |
return 0; |
return 0; |
| 227 |
227 |
} |
} |
| File src/fops_rename.c changed (mode: 100644) (index d3358e257..aae9bfd66) |
| ... |
... |
incdec_name(const char fname[], int k) |
| 595 |
595 |
{ |
{ |
| 596 |
596 |
static char result[NAME_MAX + 1]; |
static char result[NAME_MAX + 1]; |
| 597 |
597 |
char format[32]; |
char format[32]; |
| 598 |
|
char *b, *e; |
|
|
598 |
|
const char *b; |
| 599 |
599 |
int n; |
int n; |
| 600 |
600 |
|
|
| 601 |
601 |
b = strpbrk(fname, "0123456789"); |
b = strpbrk(fname, "0123456789"); |
| |
| ... |
... |
incdec_name(const char fname[], int k) |
| 616 |
616 |
--b; |
--b; |
| 617 |
617 |
} |
} |
| 618 |
618 |
|
|
|
619 |
|
char *e; |
| 619 |
620 |
long long i = strtoll(b, &e, 10); |
long long i = strtoll(b, &e, 10); |
| 620 |
621 |
|
|
| 621 |
622 |
if(i + k < 0) |
if(i + k < 0) |
| File src/utils/path.c changed (mode: 100644) (index 2a4ddb12a..e50f441b2) |
| ... |
... |
try_replace_tilde(const char path[]) |
| 501 |
501 |
char * |
char * |
| 502 |
502 |
get_last_path_component(const char path[]) |
get_last_path_component(const char path[]) |
| 503 |
503 |
{ |
{ |
| 504 |
|
char *slash = strrchr(path, '/'); |
|
|
504 |
|
const char *slash = strrchr(path, '/'); |
| 505 |
505 |
if(slash == NULL) |
if(slash == NULL) |
| 506 |
506 |
{ |
{ |
| 507 |
|
slash = (char *)path; |
|
|
507 |
|
slash = path; |
| 508 |
508 |
} |
} |
| 509 |
509 |
else if(slash[1] == '\0') |
else if(slash[1] == '\0') |
| 510 |
510 |
{ |
{ |
| |
| ... |
... |
get_last_path_component(const char path[]) |
| 523 |
523 |
{ |
{ |
| 524 |
524 |
++slash; |
++slash; |
| 525 |
525 |
} |
} |
| 526 |
|
return slash; |
|
|
526 |
|
return (char *)slash; |
| 527 |
527 |
} |
} |
| 528 |
528 |
|
|
| 529 |
529 |
void |
void |
| |
| ... |
... |
contains_slash(const char path[]) |
| 622 |
622 |
char * |
char * |
| 623 |
623 |
find_slashr(const char *path) |
find_slashr(const char *path) |
| 624 |
624 |
{ |
{ |
| 625 |
|
char *result = strrchr(path, '/'); |
|
|
625 |
|
const char *result = strrchr(path, '/'); |
| 626 |
626 |
#ifdef _WIN32 |
#ifdef _WIN32 |
| 627 |
627 |
if(result == NULL) |
if(result == NULL) |
| 628 |
628 |
result = strrchr(path, '\\'); |
result = strrchr(path, '\\'); |
| 629 |
629 |
#endif |
#endif |
| 630 |
|
return result; |
|
|
630 |
|
return (char *)result; |
| 631 |
631 |
} |
} |
| 632 |
632 |
|
|
| 633 |
633 |
char * |
char * |
| |
| ... |
... |
static char * |
| 689 |
689 |
find_ext_dot(const char path[]) |
find_ext_dot(const char path[]) |
| 690 |
690 |
{ |
{ |
| 691 |
691 |
const char *const basename = after_last(path, '/'); |
const char *const basename = after_last(path, '/'); |
| 692 |
|
char *const dot = strrchr(basename, '.'); |
|
|
692 |
|
const char *const dot = strrchr(basename, '.'); |
| 693 |
693 |
|
|
| 694 |
694 |
const int no_ext = dot == NULL |
const int no_ext = dot == NULL |
| 695 |
695 |
|| dot == basename; |
|| dot == basename; |
| 696 |
|
return no_ext ? NULL : dot; |
|
|
696 |
|
return no_ext ? NULL : (char *)dot; |
| 697 |
697 |
} |
} |
| 698 |
698 |
|
|
| 699 |
699 |
int |
int |
| File src/utils/str.c changed (mode: 100644) (index bbfc35258..a6e990015) |
| ... |
... |
strossorter(const void *s, const void *t) |
| 451 |
451 |
char * |
char * |
| 452 |
452 |
after_last(const char *str, char c) |
after_last(const char *str, char c) |
| 453 |
453 |
{ |
{ |
| 454 |
|
char *result = strrchr(str, c); |
|
|
454 |
|
const char *result = strrchr(str, c); |
| 455 |
455 |
result = (result == NULL) ? ((char *)str) : (result + 1); |
result = (result == NULL) ? ((char *)str) : (result + 1); |
| 456 |
|
return result; |
|
|
456 |
|
return (char *)result; |
| 457 |
457 |
} |
} |
| 458 |
458 |
|
|
| 459 |
459 |
char * |
char * |