Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 Mar 2014 21:45:38 +0000 (UTC)
From:      Jilles Tjoelker <jilles@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r263195 - head/bin/sh
Message-ID:  <201403142145.s2ELjcSN004790@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jilles
Date: Fri Mar 14 21:45:37 2014
New Revision: 263195
URL: http://svnweb.freebsd.org/changeset/base/263195

Log:
  sh: Add some consts.

Modified:
  head/bin/sh/expand.c
  head/bin/sh/jobs.c
  head/bin/sh/redir.c

Modified: head/bin/sh/expand.c
==============================================================================
--- head/bin/sh/expand.c	Fri Mar 14 21:35:16 2014	(r263194)
+++ head/bin/sh/expand.c	Fri Mar 14 21:45:37 2014	(r263195)
@@ -104,8 +104,8 @@ static char *expari(char *);
 static void expbackq(union node *, int, int);
 static int subevalvar(char *, char *, int, int, int, int, int);
 static char *evalvar(char *, int);
-static int varisset(char *, int);
-static void varvalue(char *, int, int, int);
+static int varisset(const char *, int);
+static void varvalue(const char *, int, int, int);
 static void recordregion(int, int, int);
 static void removerecordregions(int);
 static void ifsbreakup(char *, struct arglist *);
@@ -633,7 +633,7 @@ evalvar(char *p, int flag)
 	int subtype;
 	int varflags;
 	char *var;
-	char *val;
+	const char *val;
 	int patloc;
 	int c;
 	int set;
@@ -827,7 +827,7 @@ record:
  */
 
 static int
-varisset(char *name, int nulok)
+varisset(const char *name, int nulok)
 {
 
 	if (*name == '!')
@@ -876,7 +876,7 @@ strtodest(const char *p, int flag, int s
  */
 
 static void
-varvalue(char *name, int quoted, int subtype, int flag)
+varvalue(const char *name, int quoted, int subtype, int flag)
 {
 	int num;
 	char *p;

Modified: head/bin/sh/jobs.c
==============================================================================
--- head/bin/sh/jobs.c	Fri Mar 14 21:35:16 2014	(r263194)
+++ head/bin/sh/jobs.c	Fri Mar 14 21:45:37 2014	(r263195)
@@ -95,9 +95,9 @@ static void restartjob(struct job *);
 #endif
 static void freejob(struct job *);
 static int waitcmdloop(struct job *);
-static struct job *getjob_nonotfound(char *);
-static struct job *getjob(char *);
 pid_t getjobpgrp(char *);
+static struct job *getjob_nonotfound(const char *);
+static struct job *getjob(const char *);
 static pid_t dowait(int, struct job *);
 static void checkzombies(void);
 static void cmdtxt(union node *);
@@ -558,7 +558,7 @@ jobidcmd(int argc __unused, char **argv 
  */
 
 static struct job *
-getjob_nonotfound(char *name)
+getjob_nonotfound(const char *name)
 {
 	int jobno;
 	struct job *found, *jp;
@@ -628,7 +628,7 @@ currentjob:	if ((jp = getcurjob(NULL)) =
 
 
 static struct job *
-getjob(char *name)
+getjob(const char *name)
 {
 	struct job *jp;
 

Modified: head/bin/sh/redir.c
==============================================================================
--- head/bin/sh/redir.c	Fri Mar 14 21:35:16 2014	(r263194)
+++ head/bin/sh/redir.c	Fri Mar 14 21:45:37 2014	(r263195)
@@ -152,7 +152,7 @@ openredirect(union node *redir, char mem
 {
 	struct stat sb;
 	int fd = redir->nfile.fd;
-	char *fname;
+	const char *fname;
 	int f;
 	int e;
 
@@ -250,7 +250,7 @@ movefd:
 static int
 openhere(union node *redir)
 {
-	char *p;
+	const char *p;
 	int pip[2];
 	size_t len = 0;
 	int flags;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201403142145.s2ELjcSN004790>