diff options
author | Wichert Akkerman <wakkerma@debian.org> | 2001-12-31 16:50:22 +0000 |
---|---|---|
committer | Wichert Akkerman <wakkerma@debian.org> | 2001-12-31 16:50:22 +0000 |
commit | 23df49b33d47487473cf8ab2c48227a662b2069c (patch) | |
tree | d2068066bef44f249f898396643ac6f696556a39 | |
parent | a4f9322a6417e1683183ea2d0fca88a17b92fd3c (diff) | |
download | dpkg-23df49b33d47487473cf8ab2c48227a662b2069c.tar.gz |
No longer set LC_CTYPE and switch to using cisalpha and cisdigit instead
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | dpkg-deb/build.c | 4 | ||||
-rw-r--r-- | dselect/main.cc | 1 | ||||
-rw-r--r-- | lib/dbmodify.c | 4 | ||||
-rw-r--r-- | lib/vercmp.c | 12 | ||||
-rw-r--r-- | main/main.c | 11 | ||||
-rw-r--r-- | main/query.c | 1 | ||||
-rw-r--r-- | main/remove.c | 2 |
8 files changed, 23 insertions, 19 deletions
@@ -1,3 +1,10 @@ +Mon Dec 31 17:38:26 CET 2001 Wichert Akkerman <wakkerma@debian.org> + + * dselect/main.cc, main/main.c, main/query.c: no longer set LC_CTYPE + to C since that breaks the braindead gettext. + * dpkg-deb/build.c, lib/dbmodify.c, lib/vercmp.c, main/remove.c: Switch + to using cisdigit and cisalpha. + Mon Dec 31 17:28:10 CET 2001 Wichert Akkerman <wakkerma@debian.org> * lib/utils.c: new file with general utility functions. Add diff --git a/dpkg-deb/build.c b/dpkg-deb/build.c index a31df30b8..ae9193e0d 100644 --- a/dpkg-deb/build.c +++ b/dpkg-deb/build.c @@ -3,7 +3,7 @@ * build.c - building archives * * Copyright (C) 1994,1995 Ian Jackson <iwj10@cus.cam.ac.uk> - * Copyright (C) 2000 Wichert Akkerman <wakkerma@debian.org> + * Copyright (C) 2000,2001 Wichert Akkerman <wakkerma@debian.org> * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as @@ -62,7 +62,7 @@ struct _finfo { static void checkversion(const char *vstring, const char *valuename, int *errs) { const char *p; if (!vstring || !*vstring) return; - for (p=vstring; *p; p++) if (isdigit(*p)) return; + for (p=vstring; *p; p++) if (cisdigit(*p)) return; fprintf(stderr, _("dpkg-deb - error: %s (`%s') doesn't contain any digits\n"), valuename, vstring); (*errs)++; diff --git a/dselect/main.cc b/dselect/main.cc index e2d529d2a..7172a53a5 100644 --- a/dselect/main.cc +++ b/dselect/main.cc @@ -470,7 +470,6 @@ int main(int, const char *const *argv) { char *home, *homerc; setlocale(LC_ALL, ""); - setlocale(LC_CTYPE, "C"); bindtextdomain(PACKAGE, LOCALEDIR); textdomain(PACKAGE); diff --git a/lib/dbmodify.c b/lib/dbmodify.c index f770f836f..57aca8223 100644 --- a/lib/dbmodify.c +++ b/lib/dbmodify.c @@ -53,7 +53,7 @@ static int ulist_select(const struct dirent *de) { const char *p; int l; for (p= de->d_name, l=0; *p; p++, l++) - if (!isdigit(*p)) return 0; + if (!cisdigit(*p)) return 0; if (l > IMPORTANTMAXLEN) ohshit(_("updates directory contains file `%.250s' whose name is too long " "(length=%d, max=%d)"), de->d_name, l, IMPORTANTMAXLEN); @@ -101,7 +101,7 @@ static void cleanupdates(void) { } static void createimptmp(void) { - int i, f; + int i; onerr_abort++; diff --git a/lib/vercmp.c b/lib/vercmp.c index 56b068f3a..b97150f8e 100644 --- a/lib/vercmp.c +++ b/lib/vercmp.c @@ -34,9 +34,9 @@ int epochsdiffer(const struct versionrevision *a, /* assume ascii; warning: evaluates x multiple times! */ #define order(x) ((x) == '~' ? -1 \ - : isdigit((x)) ? 0 \ + : cisdigit((x)) ? 0 \ : !(x) ? 0 \ - : isalpha((x)) ? (x) \ + : cisalpha((x)) ? (x) \ : (x) + 256) static int verrevcmp(const char *val, const char *ref) { @@ -46,7 +46,7 @@ static int verrevcmp(const char *val, const char *ref) { while (*val || *ref) { int first_diff= 0; - while ( (*val && !isdigit(*val)) || (*ref && !isdigit(*ref)) ) { + while ( (*val && !cisdigit(*val)) || (*ref && !cisdigit(*ref)) ) { int vc= order(*val), rc= order(*ref); if (vc != rc) return vc - rc; val++; ref++; @@ -54,12 +54,12 @@ static int verrevcmp(const char *val, const char *ref) { while ( *val == '0' ) val++; while ( *ref == '0' ) ref++; - while (isdigit(*val) && isdigit(*ref)) { + while (cisdigit(*val) && cisdigit(*ref)) { if (!first_diff) first_diff= *val - *ref; val++; ref++; } - if (isdigit(*val)) return 1; - if (isdigit(*ref)) return -1; + if (cisdigit(*val)) return 1; + if (cisdigit(*ref)) return -1; if (first_diff) return first_diff; } return 0; diff --git a/main/main.c b/main/main.c index d0f1edab5..fb69022bd 100644 --- a/main/main.c +++ b/main/main.c @@ -364,19 +364,19 @@ static const struct cmdinfo cmdinfos[]= { ACTION( "configure", 0, act_configure, packages ), ACTION( "remove", 'r', act_remove, packages ), ACTION( "purge", 'P', act_purge, packages ), - ACTIONBACKEND( "listfiles", 'L', DPKGQUERY), - ACTIONBACKEND( "status", 's', DPKGQUERY), + ACTIONBACKEND( "listfiles", 'L', DPKGQUERY), + ACTIONBACKEND( "status", 's', DPKGQUERY), ACTION( "get-selections", 0, act_getselections, getselections ), ACTION( "set-selections", 0, act_setselections, setselections ), - ACTIONBACKEND( "print-avail", 'p', DPKGQUERY), + ACTIONBACKEND( "print-avail", 'p', DPKGQUERY), ACTION( "update-avail", 0, act_avreplace, updateavailable ), ACTION( "merge-avail", 0, act_avmerge, updateavailable ), ACTION( "clear-avail", 0, act_avclear, updateavailable ), ACTION( "forget-old-unavail", 0, act_forgetold, forgetold ), ACTION( "audit", 'C', act_audit, audit ), ACTION( "yet-to-unpack", 0, act_unpackchk, unpackchk ), - ACTIONBACKEND( "list", 'l', DPKGQUERY), - ACTIONBACKEND( "search", 'S', DPKGQUERY), + ACTIONBACKEND( "list", 'l', DPKGQUERY), + ACTIONBACKEND( "search", 'S', DPKGQUERY), ACTION( "print-architecture", 0, act_printarch, printarch ), ACTION( "print-gnu-build-architecture", 0, act_printgnuarch, printarch ), ACTION( "assert-support-predepends", 0, act_assertpredep, assertpredep ), @@ -550,7 +550,6 @@ int main(int argc, const char *const *argv) { char *home, *homerc; setlocale(LC_ALL, ""); - setlocale(LC_CTYPE, "C"); bindtextdomain(PACKAGE, LOCALEDIR); textdomain(PACKAGE); diff --git a/main/query.c b/main/query.c index 42957df80..8e8b4513c 100644 --- a/main/query.c +++ b/main/query.c @@ -534,7 +534,6 @@ int main(int argc, const char *const *argv) { static void (*actionfunction)(const char *const *argv); setlocale(LC_ALL, ""); - setlocale(LC_CTYPE, "C"); bindtextdomain(PACKAGE, LOCALEDIR); textdomain(PACKAGE); diff --git a/main/remove.c b/main/remove.c index c83453a8d..ba2a8863b 100644 --- a/main/remove.c +++ b/main/remove.c @@ -412,7 +412,7 @@ void removal_bulk(struct pkginfo *pkg) { if (!strcmp(*ext,de->d_name+conffbasenamelen)) goto yes_remove; p= de->d_name+conffbasenamelen; if (*p++ == '~') { - while (*p && isdigit(*p)) p++; + while (*p && cisdigit(*p)) p++; if (*p == '~' && !*++p) goto yes_remove; } } |