upstream commit
constify a few functions' arguments; patch from Jakub Jelen bz#2581 Upstream-ID: f2043f51454ea37830ff6ad60c8b32b4220f448d
This commit is contained in:
parent
c36d91bd4e
commit
da88a70a89
29
sftp.c
29
sftp.c
|
@ -1,4 +1,4 @@
|
|||
/* $OpenBSD: sftp.c,v 1.174 2016/05/25 23:48:45 schwarze Exp $ */
|
||||
/* $OpenBSD: sftp.c,v 1.175 2016/07/22 03:47:36 djm Exp $ */
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Damien Miller <djm@openbsd.org>
|
||||
*
|
||||
|
@ -337,7 +337,7 @@ local_do_ls(const char *args)
|
|||
|
||||
/* Strip one path (usually the pwd) from the start of another */
|
||||
static char *
|
||||
path_strip(char *path, char *strip)
|
||||
path_strip(const char *path, const char *strip)
|
||||
{
|
||||
size_t len;
|
||||
|
||||
|
@ -355,7 +355,7 @@ path_strip(char *path, char *strip)
|
|||
}
|
||||
|
||||
static char *
|
||||
make_absolute(char *p, char *pwd)
|
||||
make_absolute(char *p, const char *pwd)
|
||||
{
|
||||
char *abs_str;
|
||||
|
||||
|
@ -553,7 +553,7 @@ parse_no_flags(const char *cmd, char **argv, int argc)
|
|||
}
|
||||
|
||||
static int
|
||||
is_dir(char *path)
|
||||
is_dir(const char *path)
|
||||
{
|
||||
struct stat sb;
|
||||
|
||||
|
@ -565,7 +565,7 @@ is_dir(char *path)
|
|||
}
|
||||
|
||||
static int
|
||||
remote_is_dir(struct sftp_conn *conn, char *path)
|
||||
remote_is_dir(struct sftp_conn *conn, const char *path)
|
||||
{
|
||||
Attrib *a;
|
||||
|
||||
|
@ -579,7 +579,7 @@ remote_is_dir(struct sftp_conn *conn, char *path)
|
|||
|
||||
/* Check whether path returned from glob(..., GLOB_MARK, ...) is a directory */
|
||||
static int
|
||||
pathname_is_dir(char *pathname)
|
||||
pathname_is_dir(const char *pathname)
|
||||
{
|
||||
size_t l = strlen(pathname);
|
||||
|
||||
|
@ -587,8 +587,8 @@ pathname_is_dir(char *pathname)
|
|||
}
|
||||
|
||||
static int
|
||||
process_get(struct sftp_conn *conn, char *src, char *dst, char *pwd,
|
||||
int pflag, int rflag, int resume, int fflag)
|
||||
process_get(struct sftp_conn *conn, const char *src, const char *dst,
|
||||
const char *pwd, int pflag, int rflag, int resume, int fflag)
|
||||
{
|
||||
char *abs_src = NULL;
|
||||
char *abs_dst = NULL;
|
||||
|
@ -673,8 +673,8 @@ out:
|
|||
}
|
||||
|
||||
static int
|
||||
process_put(struct sftp_conn *conn, char *src, char *dst, char *pwd,
|
||||
int pflag, int rflag, int resume, int fflag)
|
||||
process_put(struct sftp_conn *conn, const char *src, const char *dst,
|
||||
const char *pwd, int pflag, int rflag, int resume, int fflag)
|
||||
{
|
||||
char *tmp_dst = NULL;
|
||||
char *abs_dst = NULL;
|
||||
|
@ -784,7 +784,8 @@ sdirent_comp(const void *aa, const void *bb)
|
|||
|
||||
/* sftp ls.1 replacement for directories */
|
||||
static int
|
||||
do_ls_dir(struct sftp_conn *conn, char *path, char *strip_path, int lflag)
|
||||
do_ls_dir(struct sftp_conn *conn, const char *path,
|
||||
const char *strip_path, int lflag)
|
||||
{
|
||||
int n;
|
||||
u_int c = 1, colspace = 0, columns = 1;
|
||||
|
@ -869,8 +870,8 @@ do_ls_dir(struct sftp_conn *conn, char *path, char *strip_path, int lflag)
|
|||
|
||||
/* sftp ls.1 replacement which handles path globs */
|
||||
static int
|
||||
do_globbed_ls(struct sftp_conn *conn, char *path, char *strip_path,
|
||||
int lflag)
|
||||
do_globbed_ls(struct sftp_conn *conn, const char *path,
|
||||
const char *strip_path, int lflag)
|
||||
{
|
||||
char *fname, *lname;
|
||||
glob_t g;
|
||||
|
@ -954,7 +955,7 @@ do_globbed_ls(struct sftp_conn *conn, char *path, char *strip_path,
|
|||
}
|
||||
|
||||
static int
|
||||
do_df(struct sftp_conn *conn, char *path, int hflag, int iflag)
|
||||
do_df(struct sftp_conn *conn, const char *path, int hflag, int iflag)
|
||||
{
|
||||
struct sftp_statvfs st;
|
||||
char s_used[FMT_SCALED_STRSIZE];
|
||||
|
|
Loading…
Reference in New Issue