From 9110ae6eaed8e36313d0b61860aeed4f1d12d3b7 Mon Sep 17 00:00:00 2001 From: cinap_lenrek Date: Thu, 6 Aug 2015 09:09:57 +0200 Subject: [PATCH] kernel: make shargs() function static in sysproc.c --- sys/src/9/port/sysproc.c | 66 +++++++++++++++++++--------------------- 1 file changed, 32 insertions(+), 34 deletions(-) diff --git a/sys/src/9/port/sysproc.c b/sys/src/9/port/sysproc.c index 8b990806c..e755bcf5a 100644 --- a/sys/src/9/port/sysproc.c +++ b/sys/src/9/port/sysproc.c @@ -9,8 +9,6 @@ #include -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*) {