* view.c (get_line_at): Use g_strreverse() instead of
reverse_string(). * util.c (reverse_string): Remove. (decompress_extension): Return const char *. (strip_home_and_password): Make dir const. * util.c (reverse_string): Fix declarations.
Этот коммит содержится в:
родитель
6b3a6dd169
Коммит
74b5eb3ac7
@ -1,3 +1,12 @@
|
||||
2002-11-12 Andrew V. Samoilov <kai@cmail.ru>
|
||||
|
||||
* view.c (get_line_at): Use g_strreverse() instead of
|
||||
reverse_string().
|
||||
* util.c (reverse_string): Remove.
|
||||
(decompress_extension): Return const char *.
|
||||
(strip_home_and_password): Make dir const.
|
||||
* util.c (reverse_string): Fix declarations.
|
||||
|
||||
2002-11-11 Pavel Roskin <proski@gnu.org>
|
||||
|
||||
* charsets.c (convert_to_display): Don't crash on empty read
|
||||
|
21
src/util.c
21
src/util.c
@ -441,7 +441,7 @@ strip_password (char *p, int has_prefix)
|
||||
return (result);
|
||||
}
|
||||
|
||||
char *strip_home_and_password(char *dir)
|
||||
char *strip_home_and_password(const char *dir)
|
||||
{
|
||||
size_t len;
|
||||
static char newdir [MC_MAXPATHLEN];
|
||||
@ -449,7 +449,7 @@ char *strip_home_and_password(char *dir)
|
||||
if (home_dir && !strncmp (dir, home_dir, len = strlen (home_dir)) &&
|
||||
(dir[len] == PATH_SEP || dir[len] == '\0')){
|
||||
newdir [0] = '~';
|
||||
strcpy (&newdir [1], &dir [strlen (home_dir)]);
|
||||
strcpy (&newdir [1], &dir [len]);
|
||||
return newdir;
|
||||
}
|
||||
|
||||
@ -903,7 +903,7 @@ int get_compression_type (int fd)
|
||||
return 0;
|
||||
}
|
||||
|
||||
char *
|
||||
const char *
|
||||
decompress_extension (int type)
|
||||
{
|
||||
switch (type){
|
||||
@ -1027,21 +1027,6 @@ char *convert_controls (char *s)
|
||||
return valcopy;
|
||||
}
|
||||
|
||||
/* Reverse the string */
|
||||
char *reverse_string (char *string)
|
||||
{
|
||||
char *str_beg = string;
|
||||
char *str_end = string + strlen (string);
|
||||
|
||||
while (--str_end > str_beg){
|
||||
char c = *str_end;
|
||||
|
||||
*str_end = *str_beg;
|
||||
*str_beg++ = c;
|
||||
}
|
||||
return string;
|
||||
}
|
||||
|
||||
static char *resolve_symlinks (char *path)
|
||||
{
|
||||
char *buf, *buf2, *p, *q, *r, c;
|
||||
|
@ -18,7 +18,7 @@ void size_trunc_len (char *buffer, int len, off_t size, int units);
|
||||
int is_exe (mode_t mode);
|
||||
char *string_perm (mode_t mode_bits);
|
||||
char *strip_password (char *path, int has_prefix);
|
||||
char *strip_home_and_password(char *dir);
|
||||
char *strip_home_and_password (const char *dir);
|
||||
char *extension (char *);
|
||||
char *concat_dir_and_file (const char *dir, const char *file);
|
||||
char *unix_error_string (int error_num);
|
||||
@ -27,7 +27,6 @@ char *skip_numbers (char *s);
|
||||
char *strip_ctrl_codes (char *s);
|
||||
char *convert_controls (char *s);
|
||||
void wipe_password (char *passwd);
|
||||
char *reverse_string (char *string);
|
||||
char *diff_two_paths (char *first, char *second);
|
||||
|
||||
char *x_basename (char *s);
|
||||
@ -111,7 +110,7 @@ enum {
|
||||
};
|
||||
|
||||
int get_compression_type (int fd);
|
||||
char *decompress_extension (int type);
|
||||
const char *decompress_extension (int type);
|
||||
|
||||
int mc_doublepopen (int inhandle, int inlen, pid_t *tp, char *command, ...);
|
||||
int mc_doublepclose (int pipehandle, pid_t pid);
|
||||
|
@ -1442,7 +1442,7 @@ get_line_at (WView *view, unsigned long *p, unsigned long *skipped)
|
||||
|
||||
/* If we are searching backwards, reverse the string */
|
||||
if (direction < 0) {
|
||||
reverse_string (buffer + 1);
|
||||
g_strreverse (buffer + 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
Загрузка…
x
Ссылка в новой задаче
Block a user