diff options
author | sopwith <sopwith> | 1999-04-07 18:57:23 +0000 |
---|---|---|
committer | sopwith <sopwith> | 1999-04-07 18:57:23 +0000 |
commit | a29ab6b3d587c5afac791e4148497ca77601268b (patch) | |
tree | 9c380b6682ad0ed62f332a34414c564b709b5db4 /popthelp.c | |
parent | dc4f62fe874e7734def1ca71034d1fbab19990a8 (diff) | |
download | libpopt-a29ab6b3d587c5afac791e4148497ca77601268b.tar.gz |
Merge (most) changes from the GNOME version of popt. The remaining changesPOST_GNOME_MERGE
are GNOME-specific.
Diffstat (limited to 'popthelp.c')
-rw-r--r-- | popthelp.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -73,10 +73,12 @@ static void singleOptionHelp(FILE * f, int maxLeftCol, int helpLength; const char * ch; char format[10]; - char * left = alloca(maxLeftCol + 1); + char * left; const char * argDescrip = getArgDescrip(opt, translation_domain); + left = malloc(maxLeftCol + 1); *left = '\0'; + if (opt->longName && opt->shortName) sprintf(left, "-%c, --%s", opt->shortName, opt->longName); else if (opt->shortName) @@ -93,7 +95,7 @@ static void singleOptionHelp(FILE * f, int maxLeftCol, fprintf(f," %-*s ", maxLeftCol, left); else { fprintf(f," %s\n", left); - return; + goto out; } helpLength = strlen(help); @@ -112,6 +114,9 @@ static void singleOptionHelp(FILE * f, int maxLeftCol, } if (helpLength) fprintf(f, "%s\n", help); + +out: + free(left); } static int maxArgWidth(const struct poptOption * opt, |