From: short <> Date: Tue, 28 Oct 2003 17:44:22 +0000 (+0000) Subject: Fixed compilation if no libreadline was detected. X-Git-Tag: captive-1_0_1~7 X-Git-Url: http://git.jankratochvil.net/?p=captive.git;a=commitdiff_plain;h=0b1ed918feadbc7864e851a4ebfd5db410bcefe5 Fixed compilation if no libreadline was detected. - SUSE-9.0 incompatibility bugreported by Christian Kristukat. --- diff --git a/src/client/cmdline/cmd_shell.c b/src/client/cmdline/cmd_shell.c index 3ea8b44..fe03e15 100644 --- a/src/client/cmdline/cmd_shell.c +++ b/src/client/cmdline/cmd_shell.c @@ -25,6 +25,7 @@ #include #include #include +#include #ifdef HAVE_LIBREADLINE #include @@ -64,10 +65,9 @@ const struct poptOption cmd_shell_table[]={ */ void cmd_shell(const char **cmd_argv,GError **errp) { -#ifdef HAVE_LIBREADLINE char *line; -#else /* HAVE_LIBREADLINE */ -char line[1024],*s; +#ifndef HAVE_LIBREADLINE +char linebuf[1024],*s; #endif /* HAVE_LIBREADLINE */ int errint,line_argc; const char **line_argv=NULL; @@ -94,7 +94,7 @@ const char *cmd_cd_args[]={NULL}; #endif /* HAVE_ADD_HISTORY */ #else /* HAVE_LIBREADLINE */ fputs(prompt,stdout); fflush(stdout); - line=fgets(line,sizeof(line),stdin); + line=fgets(linebuf,sizeof(linebuf),stdin); #endif /* HAVE_LIBREADLINE */ g_free(prompt); if (!line) { @@ -110,7 +110,7 @@ const char *cmd_cd_args[]={NULL}; line_argv=NULL; errint=poptParseArgvString(line,&line_argc,&line_argv); -#ifndef HAVE_LIBREADLINE +#ifdef HAVE_LIBREADLINE free(line); #endif /* HAVE_LIBREADLINE */ if (errint!=0) {