aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Woodward2004-11-25 05:20:10 +0000
committerJason Woodward2004-11-25 05:20:10 +0000
commit863b6711d39593938d54f7b615b2b70e75a55871 (patch)
tree952e1d184349da4ceaf2c4355a3cb55516a2c832 /src
parent84d9d1cf88bd4920b9d2bd1535a7cedeca977e6e (diff)
downloadslapt-get-863b6711d39593938d54f7b615b2b70e75a55871.tar.gz
updated code format, added comment about setbuf() bug in -current
Diffstat (limited to 'src')
-rw-r--r--src/main.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/main.c b/src/main.c
index 2f7c6b7..3859dec 100644
--- a/src/main.c
+++ b/src/main.c
@@ -22,11 +22,13 @@ static void version_info(void);
int main( int argc, char *argv[] ){
rc_config *global_config; /* our config struct */
+ pkg_action_args_t *paa;
/* getopt needs these */
int c = 0;
extern char *optarg;
extern int optind, opterr, optopt;
enum action do_action = 0;
+ int option_index = 0;
static struct option long_options[] = {
{"update", 0, 0, 'u'},
{"upgrade", 0, 0, 'g'},
@@ -57,11 +59,13 @@ int main( int argc, char *argv[] ){
{"config",1, 0, 'C'},
{"autoclean", 0, 0, 'a'},
};
- int option_index = 0;
- /* */
- pkg_action_args_t *paa;
- setvbuf(stdout, (char *)NULL, _IONBF, 0); /* unbuffer stdout */
+ /*
+ this causes problems with slackware-current...
+ segfaults in getopt_long_only() when invalid
+ option is used
+ */
+ setbuf(stdout,NULL);
#ifdef ENABLE_NLS
setlocale(LC_MESSAGES,getenv("LANG"));