From 45d8bfe09e10cecb49b030767d4bfc995d42b903 Mon Sep 17 00:00:00 2001 From: Wayne Davison Date: Tue, 28 Nov 2006 19:31:41 +0000 Subject: [PATCH] Added some more "const" prefixes to some "char *" vars. --- backup.c | 12 ++++++------ flist.c | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/backup.c b/backup.c index 85000431..2ca53fa2 100644 --- a/backup.c +++ b/backup.c @@ -35,7 +35,7 @@ extern int preserve_links; extern int safe_symlinks; /* make a complete pathname for backup file */ -char *get_backup_name(char *fname) +char *get_backup_name(const char *fname) { if (backup_dir) { if (stringjoin(backup_dir_buf + backup_dir_len, backup_dir_remainder, @@ -52,10 +52,10 @@ char *get_backup_name(char *fname) } /* simple backup creates a backup with a suffix in the same directory */ -static int make_simple_backup(char *fname) +static int make_simple_backup(const char *fname) { int rename_errno; - char *fnamebak = get_backup_name(fname); + const char *fnamebak = get_backup_name(fname); if (!fnamebak) return 0; @@ -158,7 +158,7 @@ static int make_bak_dir(char *fullpath) } /* robustly move a file, creating new directory structures if necessary */ -static int robust_move(char *src, char *dst) +static int robust_move(const char *src, char *dst) { if (robust_rename(src, dst, NULL, 0755) < 0 && (errno != ENOENT || make_bak_dir(dst) < 0 @@ -170,7 +170,7 @@ static int robust_move(char *src, char *dst) /* If we have a --backup-dir, then we get here from make_backup(). * We will move the file to be deleted into a parallel directory tree. */ -static int keep_backup(char *fname) +static int keep_backup(const char *fname) { STRUCT_STAT st; struct file_struct *file; @@ -274,7 +274,7 @@ static int keep_backup(char *fname) /* main backup switch routine */ -int make_backup(char *fname) +int make_backup(const char *fname) { if (backup_dir) return keep_backup(fname); diff --git a/flist.c b/flist.c index 06b3d46b..325c101f 100644 --- a/flist.c +++ b/flist.c @@ -718,7 +718,7 @@ static struct file_struct *receive_file_entry(struct file_list *flist, * statting directories if we're not recursing, but this is not a very * important case. Some systems may not have d_type. **/ -struct file_struct *make_file(char *fname, struct file_list *flist, +struct file_struct *make_file(const char *fname, struct file_list *flist, STRUCT_STAT *stp, unsigned short flags, int filter_level) { -- 2.34.1