From 360c0e0271c5802d68fd843ad63d2c4a1d7b2933 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Dejean?= Date: Sun, 11 Jul 2004 21:01:26 +0000 Subject: version 2.6.1 * configure.in: version 2.6.1 svn path=/branches/gnome-2-6/; revision=3453 --- support/canonicalize.c | 2 +- support/error.c | 2 +- support/findme.c | 4 ++-- support/findme.h | 2 +- support/getopt.c | 10 +++++----- support/getopt1.c | 4 ++-- support/popt-gnome.h | 12 ++++++------ support/popt.c | 4 +--- support/poptconfig.c | 12 ++++++------ support/popthelp.c | 38 +++++++++++++++++++------------------- support/poptint.h | 2 +- support/poptparse.c | 4 ++-- support/strerror.c | 2 +- support/strtod.c | 6 +++--- support/system.h | 4 ++-- support/vasprintf.c | 2 +- support/vsnprintf.c | 3 +-- 17 files changed, 55 insertions(+), 58 deletions(-) diff --git a/support/canonicalize.c b/support/canonicalize.c index a04a0ec..2ff2284 100644 --- a/support/canonicalize.c +++ b/support/canonicalize.c @@ -189,7 +189,7 @@ realpath (const char *name, char *resolved) set_errno (EINVAL); return NULL; } - + return canonicalize (name, resolved); } diff --git a/support/error.c b/support/error.c index b0264bc..3e77b31 100644 --- a/support/error.c +++ b/support/error.c @@ -169,7 +169,7 @@ error (status, errnum, message, va_alist) if (status) exit (status); } - + /* Sometimes we want to have at most one error per line. This variable controls whether this mode is selected or not. */ int error_one_per_line; diff --git a/support/findme.c b/support/findme.c index 6d1b41c..36d0447 100644 --- a/support/findme.c +++ b/support/findme.c @@ -1,5 +1,5 @@ /* (C) 1998 Red Hat Software, Inc. -- Licensing details are in the COPYING - file accompanying popt source distributions, available from + file accompanying popt source distributions, available from ftp://ftp.redhat.com/pub/code/popt */ #include "system.h" @@ -31,7 +31,7 @@ const char * findProgramPath(const char * argv0) { if (!access(buf, X_OK)) return buf; - if (chptr) + if (chptr) start = chptr + 1; else start = NULL; diff --git a/support/findme.h b/support/findme.h index 5e93963..066e228 100644 --- a/support/findme.h +++ b/support/findme.h @@ -1,5 +1,5 @@ /* (C) 1998 Red Hat Software, Inc. -- Licensing details are in the COPYING - file accompanying popt source distributions, available from + file accompanying popt source distributions, available from ftp://ftp.redhat.com/pub/code/popt */ #ifndef H_FINDME diff --git a/support/getopt.c b/support/getopt.c index 3199925..c1a384f 100644 --- a/support/getopt.c +++ b/support/getopt.c @@ -20,7 +20,7 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - + /* This tells Alpha OSF/1 not to define a getopt prototype in . Ditto for AIX 3.2 and . */ #ifndef _NO_PROTO @@ -188,7 +188,7 @@ static enum /* Value of POSIXLY_CORRECT environment variable. */ static char *posixly_correct; - + #ifdef __GNU_LIBRARY__ /* We want to avoid inclusion of string.h with non-GNU libraries because there are many ways it can cause trouble. @@ -230,7 +230,7 @@ extern int strlen (const char *); #endif /* __GNUC__ */ #endif /* not __GNU_LIBRARY__ */ - + /* Handle permutation of arguments. */ /* Describe the part of ARGV that contains non-options that have @@ -443,7 +443,7 @@ _getopt_initialize (argc, argv, optstring) return optstring; } - + /* Scan elements of ARGV (whose length is ARGC) for option characters given in OPTSTRING. @@ -967,7 +967,7 @@ getopt (argc, argv, optstring) } #endif /* Not ELIDE_CODE. */ - + #ifdef TEST /* Compile with -DTEST to make an executable for use in testing diff --git a/support/getopt1.c b/support/getopt1.c index 4aa8de6..f60f121 100644 --- a/support/getopt1.c +++ b/support/getopt1.c @@ -16,7 +16,7 @@ License along with the GNU C Library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - + #ifdef HAVE_CONFIG_H #include #endif @@ -91,7 +91,7 @@ getopt_long_only (argc, argv, options, long_options, opt_index) #endif /* Not ELIDE_CODE. */ - + #ifdef TEST #include diff --git a/support/popt-gnome.h b/support/popt-gnome.h index 5046fad..1f7aa90 100644 --- a/support/popt-gnome.h +++ b/support/popt-gnome.h @@ -1,5 +1,5 @@ /* (C) 1998 Red Hat Software, Inc. -- Licensing details are in the COPYING - file accompanying popt source distributions, available from + file accompanying popt source distributions, available from ftp://ftp.redhat.com/pub/code/popt */ #ifndef H_POPT @@ -19,8 +19,8 @@ extern "C" { #define POPT_ARG_LONG 3 #define POPT_ARG_INCLUDE_TABLE 4 /* arg points to table */ #define POPT_ARG_CALLBACK 5 /* table-wide callback... must be - set first in table; arg points - to callback, descrip points to + set first in table; arg points + to callback, descrip points to callback data to pass */ #define POPT_ARG_INTL_DOMAIN 6 /* set the translation domain for this table and any @@ -77,10 +77,10 @@ typedef struct poptContext_s * poptContext; typedef struct poptOption * poptOption; #endif -enum poptCallbackReason { POPT_CALLBACK_REASON_PRE, +enum poptCallbackReason { POPT_CALLBACK_REASON_PRE, POPT_CALLBACK_REASON_POST, POPT_CALLBACK_REASON_OPTION }; -typedef void (*poptCallbackType)(poptContext con, +typedef void (*poptCallbackType)(poptContext con, enum poptCallbackReason reason, const struct poptOption * opt, const char * arg, const void * data); @@ -104,7 +104,7 @@ void poptFreeContext( /*@only@*/ poptContext con); int poptStuffArgs(poptContext con, /*@keep@*/ const char ** argv); int poptAddAlias(poptContext con, struct poptAlias alias, int flags); int poptReadConfigFile(poptContext con, const char * fn); -/* like above, but reads /etc/popt and $HOME/.popt along with environment +/* like above, but reads /etc/popt and $HOME/.popt along with environment vars */ int poptReadDefaultConfig(poptContext con, int useEnv); /* argv should be freed -- this allows ', ", and \ quoting, but ' is treated diff --git a/support/popt.c b/support/popt.c index 283cf83..783d2c1 100644 --- a/support/popt.c +++ b/support/popt.c @@ -45,9 +45,7 @@ static void invokeCallbacks(poptContext con, const struct poptOption * table, poptContext poptGetContext(const char * name, int argc, const char ** argv, const struct poptOption * options, int flags) { - poptContext con = malloc(sizeof(*con)); - - memset(con, 0, sizeof(*con)); + poptContext con = calloc(1, sizeof *con); con->os = con->optionStack; con->os->argc = argc; diff --git a/support/poptconfig.c b/support/poptconfig.c index 7a1a4c2..094d588 100644 --- a/support/poptconfig.c +++ b/support/poptconfig.c @@ -1,5 +1,5 @@ /* (C) 1998 Red Hat Software, Inc. -- Licensing details are in the COPYING - file accompanying popt source distributions, available from + file accompanying popt source distributions, available from ftp://ftp.redhat.com/pub/code/popt */ #include "system.h" @@ -12,7 +12,7 @@ static void configLine(poptContext con, char * line) { char * entryType; char * longName = NULL; char shortName = '\0'; - + if (strncmp(line, con->appName, nameLength)) return; line += nameLength; if (!*line || !isspace(*line)) return; @@ -49,7 +49,7 @@ static void configLine(poptContext con, char * line) { con->execs[con->numExecs].shortName = shortName; con->execs[con->numExecs].script = xstrdup(line); - + con->numExecs++; } } @@ -64,7 +64,7 @@ int poptReadConfigFile(poptContext con, const char * fn) { if (fd < 0) { if (errno == ENOENT) return 0; - else + else return POPT_ERROR_ERRNO; } @@ -98,8 +98,8 @@ int poptReadConfigFile(poptContext con, const char * fn) { case '\\': *dst++ = *chptr++; if (chptr < end) { - if (*chptr == '\n') - dst--, chptr++; + if (*chptr == '\n') + dst--, chptr++; /* \ at the end of a line does not insert a \n */ else *dst++ = *chptr++; diff --git a/support/popthelp.c b/support/popthelp.c index c36ecea..dae3d94 100644 --- a/support/popthelp.c +++ b/support/popthelp.c @@ -1,7 +1,7 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ /* (C) 1998 Red Hat Software, Inc. -- Licensing details are in the COPYING - file accompanying popt source distributions, available from + file accompanying popt source distributions, available from ftp://ftp.redhat.com/pub/code/popt */ #include "system.h" @@ -9,7 +9,7 @@ static void displayArgs(poptContext con, /*@unused@*/ enum poptCallbackReason foo, - struct poptOption * key, + struct poptOption * key, /*@unused@*/ const char * arg, /*@unused@*/ void * data) { if (key->shortName== '?') poptPrintHelp(con, stdout, 0); @@ -53,7 +53,7 @@ getArgDescrip(const struct poptOption * opt, const char *translation_domain) return POPT_("ARG"); } -static void singleOptionHelp(FILE * f, int maxLeftCol, +static void singleOptionHelp(FILE * f, int maxLeftCol, const struct poptOption * opt, const char *translation_domain) { int indentLength = maxLeftCol + 5; @@ -70,7 +70,7 @@ static void singleOptionHelp(FILE * f, int maxLeftCol, if (opt->longName && opt->shortName) sprintf(left, "-%c, --%s", opt->shortName, opt->longName); - else if (opt->shortName) + else if (opt->shortName) sprintf(left, "-%c", opt->shortName); else if (opt->longName) sprintf(left, "--%s", opt->longName); @@ -83,7 +83,7 @@ static void singleOptionHelp(FILE * f, int maxLeftCol, if (help) fprintf(f," %-*s ", maxLeftCol, left); else { - fprintf(f," %s\n", left); + fprintf(f," %s\n", left); goto out; } @@ -113,7 +113,7 @@ static int maxArgWidth(const struct poptOption * opt, int max = 0; int this; const char * s; - + while (opt->longName || opt->shortName || opt->arg) { if ((opt->argInfo & POPT_ARG_MASK) == POPT_ARG_INCLUDE_TABLE) { this = maxArgWidth(opt->arg, translation_domain); @@ -133,11 +133,11 @@ static int maxArgWidth(const struct poptOption * opt, opt++; } - + return max; } -static void singleTableHelp(FILE * f, const struct poptOption * table, +static void singleTableHelp(FILE * f, const struct poptOption * table, int left, const char *translation_domain) { const struct poptOption * opt; @@ -145,7 +145,7 @@ static void singleTableHelp(FILE * f, const struct poptOption * table, opt = table; while (opt->longName || opt->shortName || opt->arg) { - if ((opt->longName || opt->shortName) && + if ((opt->longName || opt->shortName) && !(opt->argInfo & POPT_ARGFLAG_DOC_HIDDEN)) singleOptionHelp(f, left, opt, translation_domain); opt++; @@ -157,7 +157,7 @@ static void singleTableHelp(FILE * f, const struct poptOption * table, sub_transdom = getTableTranslationDomain(opt->arg); if(!sub_transdom) sub_transdom = translation_domain; - + if (opt->descrip) fprintf(f, "\n%s\n", D_(sub_transdom, opt->descrip)); @@ -195,7 +195,7 @@ void poptPrintHelp(poptContext con, FILE * f, /*@unused@*/ int flags) { singleTableHelp(f, con->options, leftColWidth, NULL); } -static int singleOptionUsage(FILE * f, int cursor, +static int singleOptionUsage(FILE * f, int cursor, const struct poptOption * opt, const char *translation_domain) { int len = 3; @@ -204,7 +204,7 @@ static int singleOptionUsage(FILE * f, int cursor, const char * argDescrip = getArgDescrip(opt, translation_domain); if (opt->shortName) { - if (!(opt->argInfo & POPT_ARG_MASK)) + if (!(opt->argInfo & POPT_ARG_MASK)) return cursor; /* we did these already */ len++; *shortStr = opt->shortName; @@ -216,13 +216,13 @@ static int singleOptionUsage(FILE * f, int cursor, if (len == 3) return cursor; - if (argDescrip) + if (argDescrip) len += strlen(argDescrip) + 1; if ((cursor + len) > 79) { fprintf(f, "\n "); cursor = 7; - } + } fprintf(f, " [-%s%s%s%s]", opt->shortName ? "" : "-", item, argDescrip ? (opt->shortName ? " " : "=") : "", @@ -234,15 +234,15 @@ static int singleOptionUsage(FILE * f, int cursor, static int singleTableUsage(FILE * f, int cursor, const struct poptOption * table, const char *translation_domain) { const struct poptOption * opt; - + opt = table; while (opt->longName || opt->shortName || opt->arg) { if ((opt->argInfo & POPT_ARG_MASK) == POPT_ARG_INTL_DOMAIN) translation_domain = (const char *)opt->arg; - else if ((opt->argInfo & POPT_ARG_MASK) == POPT_ARG_INCLUDE_TABLE) + else if ((opt->argInfo & POPT_ARG_MASK) == POPT_ARG_INCLUDE_TABLE) cursor = singleTableUsage(f, cursor, opt->arg, translation_domain); - else if ((opt->longName || opt->shortName) && + else if ((opt->longName || opt->shortName) && !(opt->argInfo & POPT_ARGFLAG_DOC_HIDDEN)) cursor = singleOptionUsage(f, cursor, opt, translation_domain); @@ -252,7 +252,7 @@ static int singleTableUsage(FILE * f, int cursor, const struct poptOption * tabl return cursor; } -static int showShortOptions(const struct poptOption * opt, FILE * f, +static int showShortOptions(const struct poptOption * opt, FILE * f, char * str) { char s[300]; /* this is larger then the ascii set, so it should do just fine */ @@ -270,7 +270,7 @@ static int showShortOptions(const struct poptOption * opt, FILE * f, showShortOptions(opt->arg, f, str); opt++; - } + } if (s != str || !*s) return 0; diff --git a/support/poptint.h b/support/poptint.h index 1688095..623b6b4 100644 --- a/support/poptint.h +++ b/support/poptint.h @@ -1,5 +1,5 @@ /* (C) 1998 Red Hat Software, Inc. -- Licensing details are in the COPYING - file accompanying popt source distributions, available from + file accompanying popt source distributions, available from ftp://ftp.redhat.com/pub/code/popt */ #ifndef H_POPTINT diff --git a/support/poptparse.c b/support/poptparse.c index 65c948b..8ed33a4 100644 --- a/support/poptparse.c +++ b/support/poptparse.c @@ -1,5 +1,5 @@ /* (C) 1998 Red Hat Software, Inc. -- Licensing details are in the COPYING - file accompanying popt source distributions, available from + file accompanying popt source distributions, available from ftp://ftp.redhat.com/pub/code/popt */ #include "system.h" @@ -20,7 +20,7 @@ int poptDupArgv(int argc, const char **argv, return POPT_ERROR_NOARG; nb += strlen(argv[i]) + 1; } - + dst = malloc(nb); argv2 = (void *) dst; dst += (argc + 1) * sizeof(*argv); diff --git a/support/strerror.c b/support/strerror.c index f8fff57..5590cca 100644 --- a/support/strerror.c +++ b/support/strerror.c @@ -670,7 +670,7 @@ strerror (errnoval) /* In range, and a valid message. Just return the message. */ msg = (char *) sys_errlist[errnoval]; } - + return (msg); } diff --git a/support/strtod.c b/support/strtod.c index c86c73d..4fd3d4e 100644 --- a/support/strtod.c +++ b/support/strtod.c @@ -39,12 +39,12 @@ strtod (str, ptr) if (ptr == (char **)0) return atof (str); - + p = str; - + while (isspace (*p)) ++p; - + if (*p == '+' || *p == '-') ++p; diff --git a/support/system.h b/support/system.h index 0f888f4..659ebb2 100644 --- a/support/system.h +++ b/support/system.h @@ -7,7 +7,7 @@ #include #include -#if HAVE_MCHECK_H +#if HAVE_MCHECK_H #include #endif @@ -25,7 +25,7 @@ #include #endif -/* AIX requires this to be the first thing in the file. */ +/* AIX requires this to be the first thing in the file. */ #ifndef __GNUC__ # if HAVE_ALLOCA_H # include diff --git a/support/vasprintf.c b/support/vasprintf.c index 64e06b8..12c37ad 100644 --- a/support/vasprintf.c +++ b/support/vasprintf.c @@ -153,7 +153,7 @@ asprintf va_end (args); return done; -} +} #ifdef TEST void diff --git a/support/vsnprintf.c b/support/vsnprintf.c index a2dfb4e..6a54d27 100644 --- a/support/vsnprintf.c +++ b/support/vsnprintf.c @@ -86,8 +86,7 @@ mcleanup(str, n, p) size_t n; char *p; { - strncpy(str, p, n-1); - str[n-1] = '\0'; + g_strlcpy(str, p, n); if (mprotect((caddr_t)(p + n + EXTRABYTES), pgsize, PROT_READ|PROT_WRITE|PROT_EXEC) == -1) mprotect((caddr_t)(p + n + EXTRABYTES), pgsize, -- cgit v1.2.1