diff options
author | Nathan Angelacos <nangel@alpinelinux.org> | 2008-12-17 01:50:47 +0000 |
---|---|---|
committer | Nathan Angelacos <nangel@alpinelinux.org> | 2008-12-17 01:50:47 +0000 |
commit | 46e27454485e4fdfe9379179d07e45999b022112 (patch) | |
tree | 2e2b534dac84c069dd854b430f006c6024342d6e | |
parent | 0983c810ea52902ccaa9948fe41369e13410338a (diff) | |
download | haserl-46e27454485e4fdfe9379179d07e45999b022112.tar.bz2 haserl-46e27454485e4fdfe9379179d07e45999b022112.tar.xz |
indent haserl.c
-rw-r--r-- | src/haserl.c | 58 |
1 files changed, 30 insertions, 28 deletions
diff --git a/src/haserl.c b/src/haserl.c index 4b7d2f2..fa6059a 100644 --- a/src/haserl.c +++ b/src/haserl.c @@ -470,8 +470,8 @@ ReadCGIPOSTValues (list_t * env) unsigned char *data; const char *CONTENT_LENGTH = "CONTENT_LENGTH"; - if ((getenv (CONTENT_LENGTH) == NULL) || - (strtoul (getenv(CONTENT_LENGTH), NULL, 10) == 0 )) + if ((getenv (CONTENT_LENGTH) == NULL) || + (strtoul (getenv (CONTENT_LENGTH), NULL, 10) == 0)) return (0); if (getenv ("CONTENT_TYPE")) @@ -711,45 +711,47 @@ main (int argc, char *argv[]) #ifdef INCLUDE_LUASHELL " and interpreted" #endif - ")\n" + ")\n" #endif #ifdef BASHEXTENSIONS - "Unsupported bash extensions supplied by simnux enabled\n" + "Unsupported bash extensions supplied by simnux enabled\n" #endif ); return (0); break; - default: /* more than one */ + default: /* more than one */ /* split combined #! args - linux bundles them as one */ command = argc_argv (argv[1], &av, ""); if (command > 1) - { - /* rebuild argv into new av2 */ - av2c = argc - 1 + command; - av2 = xmalloc (sizeof (char *) * av2c); - av2[0] = argv[0]; - for (count = 1; count <= command; count++) - { - av2[count] = av[count-1].string; - } - for (; count < av2c; count++) { - av2[count] = argv[count - command + 1]; - } - } - + { + /* rebuild argv into new av2 */ + av2c = argc - 1 + command; + av2 = xmalloc (sizeof (char *) * av2c); + av2[0] = argv[0]; + for (count = 1; count <= command; count++) + { + av2[count] = av[count - 1].string; + } + for (; count < av2c; count++) + { + av2[count] = argv[count - command + 1]; + } + } + parseCommandLine (av2c, av2); free (av); - if (av2 != argv) free (av2); + if (av2 != argv) + free (av2); if (optind < av2c) - { - filename = av2[optind]; - } + { + filename = av2[optind]; + } else - { - die_with_message (NULL, NULL, "No script file specified"); - } + { + die_with_message (NULL, NULL, "No script file specified"); + } break; } @@ -761,7 +763,7 @@ main (int argc, char *argv[]) /* populate the function pointers based on the shell selected */ if (strcmp (global.shell, "lua") && strcmp (global.shell, "luac")) - /* default to "bash" */ + /* default to "bash" */ { #ifdef INCLUDE_BASHSHELL shell_exec = &bash_exec; @@ -804,7 +806,7 @@ main (int argc, char *argv[]) global.var_prefix = "FORM."; global.nul_prefix = "ENV."; - if (global.shell[3] == 'c') /* luac only */ + if (global.shell[3] == 'c') /* luac only */ #ifdef INCLUDE_LUACSHELL shell_doscript = &luac_doscript; #else |