diff options
author | Nathan Angelacos <nangel@alpinelinux.org> | 2008-04-09 16:01:31 +0000 |
---|---|---|
committer | Nathan Angelacos <nangel@alpinelinux.org> | 2008-04-09 16:01:31 +0000 |
commit | ed4b386b68d5a073444af04d92a3df0609cfd251 (patch) | |
tree | be02cea2cb48a93a38c369ad12096c1e2315ee89 /src | |
parent | ef1e6197212624d629602763711ec99d23fe3542 (diff) | |
download | haserl-ed4b386b68d5a073444af04d92a3df0609cfd251.tar.bz2 haserl-ed4b386b68d5a073444af04d92a3df0609cfd251.tar.xz |
9.2.24rc
Diffstat (limited to 'src')
-rw-r--r-- | src/h_bash.c | 387 | ||||
-rw-r--r-- | src/h_script.c | 2 | ||||
-rw-r--r-- | src/haserl.c | 79 | ||||
-rw-r--r-- | src/rfc2388.c | 9 |
4 files changed, 266 insertions, 211 deletions
diff --git a/src/h_bash.c b/src/h_bash.c index a3f3f55..661b398 100644 --- a/src/h_bash.c +++ b/src/h_bash.c @@ -87,16 +87,16 @@ bash_setup (char *shell, list_t * env) av[count] = argv[count].string; count--; } - + /* populate the environment */ - while (env) - { - next = env->next; - putenv (env->buf); - env = next; - } - + while (env) + { + next = env->next; + putenv (env->buf); + env = next; + } + execv (argv[0].string, av); free (argv); @@ -184,27 +184,30 @@ bash_eval (buffer_t * buf, char *str, size_t len) void bash_if (buffer_t * buf, char *str, size_t len) { - static char err_msg[] = "echo 'error: missing expression for if'\nexit 99\n"; + static char err_msg[] = + "echo 'error: missing expression for if'\nexit 99\n"; static char if_start[] = "if [[ "; static char if_end[] = " ]]\nthen\n"; static char ex_start[] = "if "; static char ex_end[] = "\nthen\n"; if (len == 0) - { - buffer_add (buf, err_msg, strlen (err_msg)); - } + { + buffer_add (buf, err_msg, strlen (err_msg)); + } else if (str[0] == '|') - { - str[0] = ' '; - buffer_add (buf, ex_start, strlen (ex_start)); - buffer_add (buf, str, len); - buffer_add (buf, ex_end, strlen (ex_end)); - } else { - buffer_add (buf, if_start, strlen (if_start)); - buffer_add (buf, str, len); - buffer_add (buf, if_end, strlen (if_end)); - } + { + str[0] = ' '; + buffer_add (buf, ex_start, strlen (ex_start)); + buffer_add (buf, str, len); + buffer_add (buf, ex_end, strlen (ex_end)); + } + else + { + buffer_add (buf, if_start, strlen (if_start)); + buffer_add (buf, str, len); + buffer_add (buf, if_end, strlen (if_end)); + } } @@ -212,27 +215,30 @@ bash_if (buffer_t * buf, char *str, size_t len) void bash_elif (buffer_t * buf, char *str, size_t len) { - static char err_msg[] = "echo 'error: missing expression for elif'\nexit 99\n"; + static char err_msg[] = + "echo 'error: missing expression for elif'\nexit 99\n"; static char elif_start[] = "elif [[ "; static char elif_end[] = " ]]\nthen\n"; static char ex_start[] = "elif "; static char ex_end[] = "\nthen\n"; if (len == 0) - { - buffer_add (buf, err_msg, strlen (err_msg)); - } + { + buffer_add (buf, err_msg, strlen (err_msg)); + } else if (str[0] == '|') - { - str[0] = ' '; - buffer_add (buf, ex_start, strlen (ex_start)); - buffer_add (buf, str, len); - buffer_add (buf, ex_end, strlen (ex_end)); - } else { - buffer_add (buf, elif_start, strlen (elif_start)); - buffer_add (buf, str, len); - buffer_add (buf, elif_end, strlen (elif_end)); - } + { + str[0] = ' '; + buffer_add (buf, ex_start, strlen (ex_start)); + buffer_add (buf, str, len); + buffer_add (buf, ex_end, strlen (ex_end)); + } + else + { + buffer_add (buf, elif_start, strlen (elif_start)); + buffer_add (buf, str, len); + buffer_add (buf, elif_end, strlen (elif_end)); + } } @@ -245,12 +251,14 @@ bash_else (buffer_t * buf, char *str, size_t len) static char else_end[] = "\n"; if (len == 0) - { - buffer_add (buf, else_start, strlen (else_start)); - } else { - buffer_add (buf, else_start2, strlen (else_start2)); - buffer_add (buf, str, len); - } + { + buffer_add (buf, else_start, strlen (else_start)); + } + else + { + buffer_add (buf, else_start2, strlen (else_start2)); + buffer_add (buf, str, len); + } buffer_add (buf, else_end, strlen (else_end)); } @@ -263,13 +271,15 @@ bash_endif (buffer_t * buf, char *str, size_t len) static char fi_start2[] = "fi #"; static char fi_end[] = "\n"; - if (len == 0 ) - { - buffer_add (buf, fi_start, strlen (fi_start)); - } else { - buffer_add (buf, fi_start2, strlen (fi_start2)); - buffer_add (buf, str, len); - } + if (len == 0) + { + buffer_add (buf, fi_start, strlen (fi_start)); + } + else + { + buffer_add (buf, fi_start2, strlen (fi_start2)); + buffer_add (buf, str, len); + } buffer_add (buf, fi_end, strlen (fi_end)); } @@ -278,18 +288,21 @@ bash_endif (buffer_t * buf, char *str, size_t len) void bash_case (buffer_t * buf, char *str, size_t len) { - static char err_msg[] = "echo 'error: missing expression for case'\nexit 99\n"; + static char err_msg[] = + "echo 'error: missing expression for case'\nexit 99\n"; static char case_start[] = "case "; static char case_end[] = " in\n"; if (len == 0) - { - buffer_add (buf, err_msg, strlen (err_msg)); - } else { - buffer_add (buf, case_start, strlen (case_start)); - buffer_add (buf, str, len); - buffer_add (buf, case_end, strlen (case_end)); - } + { + buffer_add (buf, err_msg, strlen (err_msg)); + } + else + { + buffer_add (buf, case_start, strlen (case_start)); + buffer_add (buf, str, len); + buffer_add (buf, case_end, strlen (case_end)); + } } @@ -297,16 +310,19 @@ bash_case (buffer_t * buf, char *str, size_t len) void bash_when (buffer_t * buf, char *str, size_t len) { - static char err_msg[] = "echo 'error: missing expression for when'\nexit 99\n"; + static char err_msg[] = + "echo 'error: missing expression for when'\nexit 99\n"; static char elif_end[] = ")\n"; if (len == 0) - { - buffer_add (buf, err_msg, strlen (err_msg)); - } else { - buffer_add (buf, str, len-1); - buffer_add (buf, elif_end, strlen (elif_end)); - } + { + buffer_add (buf, err_msg, strlen (err_msg)); + } + else + { + buffer_add (buf, str, len - 1); + buffer_add (buf, elif_end, strlen (elif_end)); + } } @@ -319,12 +335,14 @@ bash_otherwise (buffer_t * buf, char *str, size_t len) static char otherwise_end[] = "\n"; if (len == 0) - { - buffer_add (buf, otherwise_start, strlen (otherwise_start)); - } else { - buffer_add (buf, otherwise_start2, strlen (otherwise_start2)); - buffer_add (buf, str, len); - } + { + buffer_add (buf, otherwise_start, strlen (otherwise_start)); + } + else + { + buffer_add (buf, otherwise_start2, strlen (otherwise_start2)); + buffer_add (buf, str, len); + } buffer_add (buf, otherwise_end, strlen (otherwise_end)); } @@ -337,13 +355,15 @@ bash_endcase (buffer_t * buf, char *str, size_t len) static char endcase_start2[] = "esac #"; static char endcase_end[] = "\n"; - if (len == 0 ) - { - buffer_add (buf, endcase_start, strlen (endcase_start)); - } else { - buffer_add (buf, endcase_start2, strlen (endcase_start2)); - buffer_add (buf, str, len); - } + if (len == 0) + { + buffer_add (buf, endcase_start, strlen (endcase_start)); + } + else + { + buffer_add (buf, endcase_start2, strlen (endcase_start2)); + buffer_add (buf, str, len); + } buffer_add (buf, endcase_end, strlen (endcase_end)); } @@ -352,27 +372,30 @@ bash_endcase (buffer_t * buf, char *str, size_t len) void bash_while (buffer_t * buf, char *str, size_t len) { - static char err_msg[] = "echo 'error: missing expression for while'\nexit 99\n"; + static char err_msg[] = + "echo 'error: missing expression for while'\nexit 99\n"; static char while_start[] = "while [[ "; static char while_end[] = " ]]\ndo\n"; static char ex_start[] = "while "; static char ex_end[] = "\ndo\n"; if (len == 0) - { - buffer_add (buf, err_msg, strlen (err_msg)); - } + { + buffer_add (buf, err_msg, strlen (err_msg)); + } else if (str[0] == '|') - { - str[0] = ' '; - buffer_add (buf, ex_start, strlen (ex_start)); - buffer_add (buf, str, len); - buffer_add (buf, ex_end, strlen (ex_end)); - } else { - buffer_add (buf, while_start, strlen (while_start)); - buffer_add (buf, str, len); - buffer_add (buf, while_end, strlen (while_end)); - } + { + str[0] = ' '; + buffer_add (buf, ex_start, strlen (ex_start)); + buffer_add (buf, str, len); + buffer_add (buf, ex_end, strlen (ex_end)); + } + else + { + buffer_add (buf, while_start, strlen (while_start)); + buffer_add (buf, str, len); + buffer_add (buf, while_end, strlen (while_end)); + } } @@ -385,12 +408,14 @@ bash_endwhile (buffer_t * buf, char *str, size_t len) static char endwhile_end[] = "\n"; if (len == 0) - { - buffer_add (buf, endwhile_start, strlen (endwhile_start)); - } else { - buffer_add (buf, endwhile_start2, strlen (endwhile_start2)); - buffer_add (buf, str, len); - } + { + buffer_add (buf, endwhile_start, strlen (endwhile_start)); + } + else + { + buffer_add (buf, endwhile_start2, strlen (endwhile_start2)); + buffer_add (buf, str, len); + } buffer_add (buf, endwhile_end, strlen (endwhile_end)); } @@ -399,27 +424,30 @@ bash_endwhile (buffer_t * buf, char *str, size_t len) void bash_until (buffer_t * buf, char *str, size_t len) { - static char err_msg[] = "echo 'error: missing expression for until'\nexit 99\n"; + static char err_msg[] = + "echo 'error: missing expression for until'\nexit 99\n"; static char until_start[] = "until [[ "; static char until_end[] = " ]]\ndo\n"; static char ex_start[] = "until "; static char ex_end[] = "\ndo\n"; if (len == 0) - { - buffer_add (buf, err_msg, strlen (err_msg)); - } + { + buffer_add (buf, err_msg, strlen (err_msg)); + } else if (str[0] == '|') - { - str[0] = ' '; - buffer_add (buf, ex_start, strlen (ex_start)); - buffer_add (buf, str, len); - buffer_add (buf, ex_end, strlen (ex_end)); - } else { - buffer_add (buf, until_start, strlen (until_start)); - buffer_add (buf, str, len); - buffer_add (buf, until_end, strlen (until_end)); - } + { + str[0] = ' '; + buffer_add (buf, ex_start, strlen (ex_start)); + buffer_add (buf, str, len); + buffer_add (buf, ex_end, strlen (ex_end)); + } + else + { + buffer_add (buf, until_start, strlen (until_start)); + buffer_add (buf, str, len); + buffer_add (buf, until_end, strlen (until_end)); + } } @@ -432,12 +460,14 @@ bash_enduntil (buffer_t * buf, char *str, size_t len) static char enduntil_end[] = "\n"; if (len == 0) - { - buffer_add (buf, enduntil_start, strlen (enduntil_start)); - } else { - buffer_add (buf, enduntil_start2, strlen (enduntil_start2)); - buffer_add (buf, str, len); - } + { + buffer_add (buf, enduntil_start, strlen (enduntil_start)); + } + else + { + buffer_add (buf, enduntil_start2, strlen (enduntil_start2)); + buffer_add (buf, str, len); + } buffer_add (buf, enduntil_end, strlen (enduntil_end)); } @@ -446,18 +476,21 @@ bash_enduntil (buffer_t * buf, char *str, size_t len) void bash_for (buffer_t * buf, char *str, size_t len) { - static char err_msg[] = "echo 'error: missing expression for for'\nexit 99\n"; + static char err_msg[] = + "echo 'error: missing expression for for'\nexit 99\n"; static char for_start[] = "for "; static char for_end[] = "\ndo\n"; if (len == 0) - { - buffer_add (buf, err_msg, strlen (err_msg)); - } else { - buffer_add (buf, for_start, strlen (for_start)); - buffer_add (buf, str, len); - buffer_add (buf, for_end, strlen (for_end)); - } + { + buffer_add (buf, err_msg, strlen (err_msg)); + } + else + { + buffer_add (buf, for_start, strlen (for_start)); + buffer_add (buf, str, len); + buffer_add (buf, for_end, strlen (for_end)); + } } @@ -470,12 +503,14 @@ bash_endfor (buffer_t * buf, char *str, size_t len) static char endfor_end[] = "\n"; if (len == 0) - { - buffer_add (buf, endfor_start, strlen (endfor_start)); - } else { - buffer_add (buf, endfor_start2, strlen (endfor_start2)); - buffer_add (buf, str, len); - } + { + buffer_add (buf, endfor_start, strlen (endfor_start)); + } + else + { + buffer_add (buf, endfor_start2, strlen (endfor_start2)); + buffer_add (buf, str, len); + } buffer_add (buf, endfor_end, strlen (endfor_end)); } @@ -484,27 +519,30 @@ bash_endfor (buffer_t * buf, char *str, size_t len) void bash_unless (buffer_t * buf, char *str, size_t len) { - static char err_msg[] = "echo 'error: missing expression for unless'\nexit 99\n"; + static char err_msg[] = + "echo 'error: missing expression for unless'\nexit 99\n"; static char unless_start[] = "if [[ ! ( "; static char unless_end[] = " ) ]]\nthen\n"; static char ex_start[] = "if ! "; static char ex_end[] = "\nthen\n"; if (len == 0) - { - buffer_add (buf, err_msg, strlen (err_msg)); - } + { + buffer_add (buf, err_msg, strlen (err_msg)); + } else if (str[0] == '|') - { - str[0] = ' '; - buffer_add (buf, ex_start, strlen (ex_start)); - buffer_add (buf, str, len); - buffer_add (buf, ex_end, strlen (ex_end)); - } else { - buffer_add (buf, unless_start, strlen (unless_start)); - buffer_add (buf, str, len); - buffer_add (buf, unless_end, strlen (unless_end)); - } + { + str[0] = ' '; + buffer_add (buf, ex_start, strlen (ex_start)); + buffer_add (buf, str, len); + buffer_add (buf, ex_end, strlen (ex_end)); + } + else + { + buffer_add (buf, unless_start, strlen (unless_start)); + buffer_add (buf, str, len); + buffer_add (buf, unless_end, strlen (unless_end)); + } } @@ -512,27 +550,30 @@ bash_unless (buffer_t * buf, char *str, size_t len) void bash_elun (buffer_t * buf, char *str, size_t len) { - static char err_msg[] = "echo 'error: missing expression for elun'\nexit 99\n"; + static char err_msg[] = + "echo 'error: missing expression for elun'\nexit 99\n"; static char elun_start[] = "elif [[ ! ( "; static char elun_end[] = " ) ]]\nthen\n"; static char ex_start[] = "elif ! "; static char ex_end[] = "\nthen\n"; if (len == 0) - { - buffer_add (buf, err_msg, strlen (err_msg)); - } + { + buffer_add (buf, err_msg, strlen (err_msg)); + } else if (str[0] == '|') - { - str[0] = ' '; - buffer_add (buf, ex_start, strlen (ex_start)); - buffer_add (buf, str, len); - buffer_add (buf, ex_end, strlen (ex_end)); - } else { - buffer_add (buf, elun_start, strlen (elun_start)); - buffer_add (buf, str, len); - buffer_add (buf, elun_end, strlen (elun_end)); - } + { + str[0] = ' '; + buffer_add (buf, ex_start, strlen (ex_start)); + buffer_add (buf, str, len); + buffer_add (buf, ex_end, strlen (ex_end)); + } + else + { + buffer_add (buf, elun_start, strlen (elun_start)); + buffer_add (buf, str, len); + buffer_add (buf, elun_end, strlen (elun_end)); + } } @@ -545,12 +586,14 @@ bash_unelse (buffer_t * buf, char *str, size_t len) static char unelse_end[] = "\n"; if (len == 0) - { - buffer_add (buf, unelse_start, strlen (unelse_start)); - } else { - buffer_add (buf, unelse_start2, strlen (unelse_start2)); - buffer_add (buf, str, len); - } + { + buffer_add (buf, unelse_start, strlen (unelse_start)); + } + else + { + buffer_add (buf, unelse_start2, strlen (unelse_start2)); + buffer_add (buf, str, len); + } buffer_add (buf, unelse_end, strlen (unelse_end)); } @@ -564,12 +607,14 @@ bash_endunless (buffer_t * buf, char *str, size_t len) static char endunless_end[] = "\n"; if (len == 0) - { - buffer_add (buf, endunless_start, strlen (endunless_start)); - } else { - buffer_add (buf, endunless_start2, strlen (endunless_start2)); - buffer_add (buf, str, len); - } + { + buffer_add (buf, endunless_start, strlen (endunless_start)); + } + else + { + buffer_add (buf, endunless_start2, strlen (endunless_start2)); + buffer_add (buf, str, len); + } buffer_add (buf, endunless_end, strlen (endunless_end)); } #endif diff --git a/src/h_script.c b/src/h_script.c index 12aa0a9..029fc41 100644 --- a/src/h_script.c +++ b/src/h_script.c @@ -51,7 +51,7 @@ const char *g_tag[] = { "in", "=", "#", -#ifdef BASHEXTENSIONS +#ifdef BASHEXTENSIONS "if", "elif", "else", diff --git a/src/haserl.c b/src/haserl.c index aa841ef..8477e5e 100644 --- a/src/haserl.c +++ b/src/haserl.c @@ -91,32 +91,32 @@ haserl_t global; /* declare the shell_ function pointers here */ -void (*shell_exec) (buffer_t *buf, char *str); -void (*shell_echo) (buffer_t *buf, char *str, size_t len); -void (*shell_eval) (buffer_t *buf, char *str, size_t len); +void (*shell_exec) (buffer_t * buf, char *str); +void (*shell_echo) (buffer_t * buf, char *str, size_t len); +void (*shell_eval) (buffer_t * buf, char *str, size_t len); void (*shell_setup) (char *, list_t *); void (*shell_doscript) (buffer_t *, char *); void (*shell_destroy) (void); #ifdef BASHEXTENSIONS -void (*shell_if) (buffer_t *buf, char *str, size_t len); -void (*shell_elif) (buffer_t *buf, char *str, size_t len); -void (*shell_else) (buffer_t *buf, char *str, size_t len); -void (*shell_endif) (buffer_t *buf, char *str, size_t len); -void (*shell_case) (buffer_t *buf, char *str, size_t len); -void (*shell_when) (buffer_t *buf, char *str, size_t len); -void (*shell_otherwise) (buffer_t *buf, char *str, size_t len); -void (*shell_endcase) (buffer_t *buf, char *str, size_t len); -void (*shell_while) (buffer_t *buf, char *str, size_t len); -void (*shell_endwhile) (buffer_t *buf, char *str, size_t len); -void (*shell_until) (buffer_t *buf, char *str, size_t len); -void (*shell_enduntil) (buffer_t *buf, char *str, size_t len); -void (*shell_for) (buffer_t *buf, char *str, size_t len); -void (*shell_endfor) (buffer_t *buf, char *str, size_t len); -void (*shell_unless) (buffer_t *buf, char *str, size_t len); -void (*shell_elun) (buffer_t *buf, char *str, size_t len); -void (*shell_unelse) (buffer_t *buf, char *str, size_t len); -void (*shell_endunless) (buffer_t *buf, char *str, size_t len); +void (*shell_if) (buffer_t * buf, char *str, size_t len); +void (*shell_elif) (buffer_t * buf, char *str, size_t len); +void (*shell_else) (buffer_t * buf, char *str, size_t len); +void (*shell_endif) (buffer_t * buf, char *str, size_t len); +void (*shell_case) (buffer_t * buf, char *str, size_t len); +void (*shell_when) (buffer_t * buf, char *str, size_t len); +void (*shell_otherwise) (buffer_t * buf, char *str, size_t len); +void (*shell_endcase) (buffer_t * buf, char *str, size_t len); +void (*shell_while) (buffer_t * buf, char *str, size_t len); +void (*shell_endwhile) (buffer_t * buf, char *str, size_t len); +void (*shell_until) (buffer_t * buf, char *str, size_t len); +void (*shell_enduntil) (buffer_t * buf, char *str, size_t len); +void (*shell_for) (buffer_t * buf, char *str, size_t len); +void (*shell_endfor) (buffer_t * buf, char *str, size_t len); +void (*shell_unless) (buffer_t * buf, char *str, size_t len); +void (*shell_elun) (buffer_t * buf, char *str, size_t len); +void (*shell_unelse) (buffer_t * buf, char *str, size_t len); +void (*shell_endunless) (buffer_t * buf, char *str, size_t len); #endif /* global shell execution function pointers. These point to the actual functions @@ -225,11 +225,12 @@ myputenv (list_t * cur, char *str, char *prefix) int array = 0; int len; - temp = memchr (str, '=', strlen(str)); + temp = memchr (str, '=', strlen (str)); /* if we don't have an equal sign, exit early */ - if (temp == 0 ) { - return (cur); - } + if (temp == 0) + { + return (cur); + } keylen = (size_t) (temp - str); @@ -597,8 +598,7 @@ parseCommandLine (int argc, char *argv[]) case 'v': case 'h': printf ("This is " PACKAGE_NAME " version " PACKAGE_VERSION "" - "(http://haserl.sourceforge.net)\n" - "Extended by simnux (unsupported)"); + "(http://haserl.sourceforge.net)"); exit (0); break; } @@ -703,7 +703,17 @@ main (int argc, char *argv[]) puts ("This is " PACKAGE_NAME " version " PACKAGE_VERSION "\n" "This program runs as a cgi interpeter, not interactively\n" "Please see: http://haserl.sourceforge.net\n" - "Extended by simnux (unsupported)"); +#ifdef USE_LUA + "This version includes Lua (precompiled" +#ifdef INCLUDE_LUASHELL + " and interpreted" +#endif + ")\n" +#endif +#ifdef BASHEXTENSIONS + "Unsupported bash extensions supplied by simnux enabled\n" +#endif + ); return (0); break; case 2: @@ -734,7 +744,8 @@ main (int argc, char *argv[]) BecomeUser (scriptchain->uid, scriptchain->gid); /* populate the function pointers based on the shell selected */ - if (strcmp (global.shell, "lua") && strcmp (global.shell, "luac")) /* default to "bash" */ + if (strcmp (global.shell, "lua") && strcmp (global.shell, "luac")) + /* default to "bash" */ { #ifdef INCLUDE_BASHSHELL shell_exec = &bash_exec; @@ -744,7 +755,7 @@ main (int argc, char *argv[]) shell_doscript = &bash_doscript; shell_destroy = &bash_destroy; -#ifdef BASH_EXTENSIONS +#ifdef BASHEXTENSIONS shell_if = &bash_if; shell_elif = &bash_elif; shell_else = &bash_else; @@ -777,7 +788,7 @@ main (int argc, char *argv[]) global.var_prefix = "FORM."; global.nul_prefix = "ENV."; - if (global.shell[3] == 'c') /* compiled Lua specific function ptr... */ + if (global.shell[3] == 'c') /* luac only */ #ifdef INCLUDE_LUACSHELL shell_doscript = &luac_doscript; #else @@ -840,10 +851,8 @@ main (int argc, char *argv[]) #ifndef JUST_LUACSHELL if (strcmp (global.shell, "luac")) { - printf ("Process_token_list is %p\n", process_token_list); - printf ("script text is %p and tokenchain is %p\n", &script_text, tokenchain); - process_token_list (&script_text, tokenchain); - } + process_token_list (&script_text, tokenchain); + } #endif /* run the script */ diff --git a/src/rfc2388.c b/src/rfc2388.c index 757a01e..8aa5d19 100644 --- a/src/rfc2388.c +++ b/src/rfc2388.c @@ -383,8 +383,9 @@ rfc2388_handler (list_t * env) memcpy (boundary + 4, str + i, strlen (str + i) + 1); if ((i > 0) && (str[i - 1] == '"')) { - while ((boundary[i]) && (boundary[i] != '"')) i++; - boundary[i] = '\0'; + while ((boundary[i]) && (boundary[i] != '"')) + i++; + boundary[i] = '\0'; } /* Allow 2MB content, unless they have a global upload set */ @@ -394,9 +395,9 @@ rfc2388_handler (list_t * env) /* initialize a 128K sliding buffer */ s_buffer_init (&sbuf, 1024 * 128); sbuf.fh = STDIN; - if (getenv("CONTENT_LENGTH")) + if (getenv ("CONTENT_LENGTH")) { - sbuf.maxread = strtoul(getenv("CONTENT_LENGTH"), NULL, 10); + sbuf.maxread = strtoul (getenv ("CONTENT_LENGTH"), NULL, 10); } /* initialize the buffer, and make sure it doesn't point to null */ |