kernel: make shargs() function static in sysproc.c

This commit is contained in:
cinap_lenrek 2015-08-06 09:09:57 +02:00
parent 2acb02f29b
commit 9110ae6eae

View file

@ -9,8 +9,6 @@
#include <a.out.h>
int shargs(char*, int, char**);
extern void checkpages(void);
extern void checkpagerefs(void);
@ -224,6 +222,38 @@ sysrfork(va_list list)
return pid;
}
static int
shargs(char *s, int n, char **ap)
{
int i;
s += 2;
n -= 2; /* skip #! */
for(i=0;; i++){
if(i >= n)
return 0;
if(s[i]=='\n')
break;
}
s[i] = 0;
i = 0;
for(;;) {
while(*s==' ' || *s=='\t')
s++;
if(*s == 0)
break;
ap[i++] = s++;
while(*s && *s!=' ' && *s!='\t')
s++;
if(*s == 0)
break;
*s++ = 0;
}
ap[i] = nil;
return i;
}
static ulong
l2be(long l)
{
@ -535,38 +565,6 @@ sysexec(va_list list)
return execregs(entry, ssize, nargs);
}
int
shargs(char *s, int n, char **ap)
{
int i;
s += 2;
n -= 2; /* skip #! */
for(i=0;; i++){
if(i >= n)
return 0;
if(s[i]=='\n')
break;
}
s[i] = 0;
i = 0;
for(;;) {
while(*s==' ' || *s=='\t')
s++;
if(*s == 0)
break;
ap[i++] = s++;
while(*s && *s!=' ' && *s!='\t')
s++;
if(*s == 0)
break;
*s++ = 0;
}
ap[i] = nil;
return i;
}
int
return0(void*)
{