Matt McCutchen's Web Site
/
rsync
/
rsync.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Refactorings to the filter code, most notably:
[rsync/rsync.git]
/
popt
/
popthelp.c
diff --git
a/popt/popthelp.c
b/popt/popthelp.c
index
eb735ff
..
6a00976
100644
(file)
--- a/
popt/popthelp.c
+++ b/
popt/popthelp.c
@@
-10,7
+10,7
@@
#include "system.h"
#include "system.h"
-#define POPT_WCHAR_HACK
+/*#define POPT_WCHAR_HACK*/
#ifdef POPT_WCHAR_HACK
#include <wchar.h> /* for mbsrtowcs */
/*@access mbstate_t @*/
#ifdef POPT_WCHAR_HACK
#include <wchar.h> /* for mbsrtowcs */
/*@access mbstate_t @*/
@@
-121,7
+121,7
@@
getArgDescrip(const struct poptOption * opt,
if (opt->argDescrip) return D_(translation_domain, opt->argDescrip);
switch (opt->argInfo & POPT_ARG_MASK) {
if (opt->argDescrip) return D_(translation_domain, opt->argDescrip);
switch (opt->argInfo & POPT_ARG_MASK) {
- case POPT_ARG_NONE: return POPT_("NONE");
+ /*case POPT_ARG_NONE: return POPT_("NONE");*/ /* impossible */
#ifdef DYING
case POPT_ARG_VAL: return POPT_("VAL");
#else
#ifdef DYING
case POPT_ARG_VAL: return POPT_("VAL");
#else
@@
-360,7
+360,7
@@
static void singleOptionHelp(FILE * fp, size_t maxLeftCol,
/*@=boundswrite@*/
if (help)
/*@=boundswrite@*/
if (help)
- fprintf(fp," %-*s ", maxLeftCol+displaypad, left);
+ fprintf(fp," %-*s ",
(int)
maxLeftCol+displaypad, left);
else {
fprintf(fp," %s\n", left);
goto out;
else {
fprintf(fp," %s\n", left);
goto out;
@@
-381,9
+381,9
@@
static void singleOptionHelp(FILE * fp, size_t maxLeftCol,
char format[16];
ch = help + lineLength - 1;
char format[16];
ch = help + lineLength - 1;
- while (ch > help && !is
space(*
ch)) ch--;
+ while (ch > help && !is
Space(
ch)) ch--;
if (ch == help) break; /* give up */
if (ch == help) break; /* give up */
- while (ch > (help + 1) && is
space(*
ch)) ch--;
+ while (ch > (help + 1) && is
Space(
ch)) ch--;
ch++;
snprintf(format, sizeof format, "%%.%ds\n%%%ds", (int) (ch - help), (int) indentLength);
ch++;
snprintf(format, sizeof format, "%%.%ds\n%%%ds", (int) (ch - help), (int) indentLength);
@@
-391,7
+391,7
@@
static void singleOptionHelp(FILE * fp, size_t maxLeftCol,
fprintf(fp, format, help, " ");
/*@=formatconst@*/
help = ch;
fprintf(fp, format, help, " ");
/*@=formatconst@*/
help = ch;
- while (is
space(*
help) && *help) help++;
+ while (is
Space(
help) && *help) help++;
helpLength = strlen(help);
}
/*@=boundsread@*/
helpLength = strlen(help);
}
/*@=boundsread@*/
@@
-767,6
+767,9
@@
static int showShortOptions(const struct poptOption * opt, FILE * fp,
char * s = (str != NULL ? str : memset(alloca(300), 0, 300));
int len = 0;
char * s = (str != NULL ? str : memset(alloca(300), 0, 300));
int len = 0;
+ if (s == NULL)
+ return 0;
+
/*@-boundswrite@*/
if (opt != NULL)
for (; (opt->longName || opt->shortName || opt->arg); opt++) {
/*@-boundswrite@*/
if (opt != NULL)
for (; (opt->longName || opt->shortName || opt->arg); opt++) {