~mathiaz/ubuntu/lucid/mysql-dfsg-5.1/zap-bug-552053

« back to all changes in this revision

Viewing changes to cmd-line-utils/libedit/map.c

  • Committer: Bazaar Package Importer
  • Author(s): Mathias Gug
  • Date: 2009-06-25 12:55:45 UTC
  • mfrom: (1.1.2 upstream) (0.1.3 experimental)
  • Revision ID: james.westby@ubuntu.com-20090625125545-m8ogs96zzsri74xe
Tags: 5.1.34-1ubuntu1
* Merge from debian experimental (and 5.0 from main), remaining changes:
  - debian/mysql-server-5.1.config:
    + ask for MySQL root password at priority high instead of medium so
      that the password prompt is seen on a default install. (LP: #319843)
    + don't ask for root password when upgrading from a 5.0 install.
  - debian/control:
    + Make libmysqlclient16-dev a transitional package depending on
      libmysqlclient-dev.
    + Make libmysqlclient-dev conflict with libmysqlclient15-dev.
    + Don't build mysql-server, mysql-client, mysql-common and
      libmysqlclient15-dev binary packages since they're still provided
      by mysql-dfsg-5.0.
    + Make mysql-{client,server}-5.1 packages conflict and
      replace mysql-{client,server}-5.0, but not provide
      mysql-{client,server}.
    + Depend on a specific version of mysql-common rather than the src
      version of mysql-dfsg-5.1 since mysql-common is currently part of
      mysql-dfsg-5.0.
    + Lower mailx from a Recommends to a Suggests to avoid pulling in
      a full MTA on all installs of mysql-server. (LP: #259477)
  - debian/rules:
    + added -fno-strict-aliasing to CFLAGS to get around mysql testsuite
      build failures.
    + install mysql-test and sql-bench to /usr/share/mysql/ rather than
      /usr/.
  - debian/additions/debian-start.inc.sh: support ANSI mode (LP: #310211)
  - Add AppArmor profile:
    - debian/apparmor-profile: apparmor profile.
    - debian/rules, debian/mysql-server-5.0.files: install apparmor profile.
    - debian/mysql-server-5.0.dirs: add etc/apparmor.d/force-complain
    - debian/mysql-server-5.0.postrm: remove symlink in force-complain/ on
      purge.
    - debian/mysql-server-5.1.README.Debian: add apparmor documentation.
    - debian/additions/my.cnf: Add warning about apparmor. (LP: #201799)
    - debian/mysql-server-5.1.postinst: reload apparmor profiles.
  - debian/additions/my.cnf: remove language option. Error message files are
    located in a different directory in MySQL 5.0. Setting the language
    option to use /usr/share/mysql/english breaks 5.0. Both 5.0 and 5.1
    use a default value that works. (LP: #316974)
  - debian/mysql-server-5.1.mysql.init:
    + Clearly indicate that we do not support running multiple instances
      of mysqld by duplicating the init script.
      (closes: #314785, #324834, #435165, #444216)
    + Properly parameterize all existing references to the mysql config
      file (/etc/mysql/my.cnf).
  - debian/mysql-server-5.0.postinst: Clear out the second password
    when setting up mysql. (LP: #344816)
  - mysql-server-core-5.1 package for files needed by Akonadi:
    + debian/control: create mysql-server-core-5.1 package.
    + debian/mysql-server-core-5.1.files, debian/mysql-server-5.1.files:
      move core mysqld files to mysql-server-core-5.1 package.
  - Don't package sql-bench and mysql-test file.
* Dropped changes:
  - debian/patches/92_ssl_test_cert.dpatch: certificate expiration in
    test suite (LP: #323755). Included upstream.
* Dropped from 5.0:
  - apparmor profile:
    - debian/control: Recommends apparmor >= 2.1+1075-0ubuntu6. All version
      of apparmor-profile (>hardy) are higher than this version.
    - debian/mysql-server-5.0.preinst: create symlink for force-complain/
      on pre-feisty upgrades, upgrades where apparmor-profiles profile is
      unchanged (ie non-enforcing) and upgrades where the profile
      doesn't exist. Support for pre-hardy upgrades is no longer needed.
* debian/mysql-server-5.1.postinst: fix debian-sys-maint user creation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*      $NetBSD: map.c,v 1.20 2004/08/13 12:10:39 mycroft Exp $ */
 
1
/*      $NetBSD: map.c,v 1.24 2006/04/09 01:36:51 christos Exp $        */
2
2
 
3
3
/*-
4
4
 * Copyright (c) 1992, 1993
32
32
 * SUCH DAMAGE.
33
33
 */
34
34
 
35
 
#include <config.h>
 
35
#include "config.h"
 
36
#if !defined(lint) && !defined(SCCSID)
 
37
#if 0
 
38
static char sccsid[] = "@(#)map.c       8.1 (Berkeley) 6/4/93";
 
39
#else
 
40
#endif
 
41
#endif /* not lint && not SCCSID */
36
42
 
37
43
/*
38
44
 * map.c: Editor function definitions
1118
1124
map_print_key(EditLine *el, el_action_t *map, const char *in)
1119
1125
{
1120
1126
        char outbuf[EL_BUFSIZ];
1121
 
        el_bindings_t *bp;
 
1127
        el_bindings_t *bp, *ep;
1122
1128
 
1123
1129
        if (in[0] == '\0' || in[1] == '\0') {
1124
 
                (void) key__decode_str(in, outbuf, "");
1125
 
                for (bp = el->el_map.help; bp->name != NULL; bp++)
 
1130
                (void) key__decode_str(in, outbuf, sizeof(outbuf), "");
 
1131
                ep = &el->el_map.help[el->el_map.nfunc];
 
1132
                for (bp = el->el_map.help; bp < ep; bp++)
1126
1133
                        if (bp->func == map[(unsigned char) *in]) {
1127
1134
                                (void) fprintf(el->el_outfile,
1128
1135
                                    "%s\t->\t%s\n", outbuf, bp->name);
1139
1146
private void
1140
1147
map_print_some_keys(EditLine *el, el_action_t *map, int first, int last)
1141
1148
{
1142
 
        el_bindings_t *bp;
 
1149
        el_bindings_t *bp, *ep;
1143
1150
        char firstbuf[2], lastbuf[2];
1144
1151
        char unparsbuf[EL_BUFSIZ], extrabuf[EL_BUFSIZ];
1145
1152
 
1148
1155
        lastbuf[0] = last;
1149
1156
        lastbuf[1] = 0;
1150
1157
        if (map[first] == ED_UNASSIGNED) {
1151
 
                if (first == last)
 
1158
                if (first == last) {
 
1159
                        (void) key__decode_str(firstbuf, unparsbuf, 
 
1160
                            sizeof(unparsbuf), STRQQ);
1152
1161
                        (void) fprintf(el->el_outfile,
1153
 
                            "%-15s->  is undefined\n",
1154
 
                            key__decode_str(firstbuf, unparsbuf, STRQQ));
 
1162
                            "%-15s->  is undefined\n", unparsbuf);
 
1163
                }
1155
1164
                return;
1156
1165
        }
1157
 
        for (bp = el->el_map.help; bp->name != NULL; bp++) {
 
1166
        ep = &el->el_map.help[el->el_map.nfunc];
 
1167
        for (bp = el->el_map.help; bp < ep; bp++) {
1158
1168
                if (bp->func == map[first]) {
1159
1169
                        if (first == last) {
 
1170
                                (void) key__decode_str(firstbuf, unparsbuf, 
 
1171
                                    sizeof(unparsbuf), STRQQ);
1160
1172
                                (void) fprintf(el->el_outfile, "%-15s->  %s\n",
1161
 
                                    key__decode_str(firstbuf, unparsbuf, STRQQ),
1162
 
                                    bp->name);
 
1173
                                    unparsbuf, bp->name);
1163
1174
                        } else {
 
1175
                                (void) key__decode_str(firstbuf, unparsbuf, 
 
1176
                                    sizeof(unparsbuf), STRQQ);
 
1177
                                (void) key__decode_str(lastbuf, extrabuf, 
 
1178
                                    sizeof(extrabuf), STRQQ);
1164
1179
                                (void) fprintf(el->el_outfile,
1165
1180
                                    "%-4s to %-7s->  %s\n",
1166
 
                                    key__decode_str(firstbuf, unparsbuf, STRQQ),
1167
 
                                    key__decode_str(lastbuf, extrabuf, STRQQ),
1168
 
                                    bp->name);
 
1181
                                    unparsbuf, extrabuf, bp->name);
1169
1182
                        }
1170
1183
                        return;
1171
1184
                }
1172
1185
        }
1173
1186
#ifdef MAP_DEBUG
1174
1187
        if (map == el->el_map.key) {
 
1188
                (void) key__decode_str(firstbuf, unparsbuf, 
 
1189
                    sizeof(unparsbuf), STRQQ);
1175
1190
                (void) fprintf(el->el_outfile,
1176
 
                    "BUG!!! %s isn't bound to anything.\n",
1177
 
                    key__decode_str(firstbuf, unparsbuf, STRQQ));
 
1191
                    "BUG!!! %s isn't bound to anything.\n", unparsbuf);
1178
1192
                (void) fprintf(el->el_outfile, "el->el_map.key[%d] == %d\n",
1179
1193
                    first, el->el_map.key[first]);
1180
1194
        } else {
 
1195
                (void) key__decode_str(firstbuf, unparsbuf, 
 
1196
                    sizeof(unparsbuf), STRQQ);
1181
1197
                (void) fprintf(el->el_outfile,
1182
 
                    "BUG!!! %s isn't bound to anything.\n",
1183
 
                    key__decode_str(firstbuf, unparsbuf, STRQQ));
 
1198
                    "BUG!!! %s isn't bound to anything.\n", unparsbuf);
1184
1199
                (void) fprintf(el->el_outfile, "el->el_map.alt[%d] == %d\n",
1185
1200
                    first, el->el_map.alt[first]);
1186
1201
        }
1237
1252
        char outbuf[EL_BUFSIZ];
1238
1253
        const char *in = NULL;
1239
1254
        char *out = NULL;
1240
 
        el_bindings_t *bp;
 
1255
        el_bindings_t *bp, *ep;
1241
1256
        int cmd;
1242
1257
        int key;
1243
1258
 
1279
1294
                                return (0);
1280
1295
 
1281
1296
                        case 'l':
1282
 
                                for (bp = el->el_map.help; bp->name != NULL;
1283
 
                                    bp++)
 
1297
                                ep = &el->el_map.help[el->el_map.nfunc];
 
1298
                                for (bp = el->el_map.help; bp < ep; bp++)
1284
1299
                                        (void) fprintf(el->el_outfile,
1285
1300
                                            "%s\n\t%s\n",
1286
1301
                                            bp->name, bp->description);
1367
1382
                break;
1368
1383
 
1369
1384
        default:
1370
 
                EL_ABORT((el->el_errfile, "Bad XK_ type\n", ntype));
 
1385
                EL_ABORT((el->el_errfile, "Bad XK_ type %d\n", ntype));
1371
1386
                break;
1372
1387
        }
1373
1388
        return (0);
1381
1396
map_addfunc(EditLine *el, const char *name, const char *help, el_func_t func)
1382
1397
{
1383
1398
        void *p;
1384
 
        int nf = el->el_map.nfunc + 2;
 
1399
        int nf = el->el_map.nfunc + 1;
1385
1400
 
1386
1401
        if (name == NULL || help == NULL || func == NULL)
1387
1402
                return (-1);
1400
1415
        el->el_map.help[nf].name = name;
1401
1416
        el->el_map.help[nf].func = nf;
1402
1417
        el->el_map.help[nf].description = help;
1403
 
        el->el_map.help[++nf].name = NULL;
1404
1418
        el->el_map.nfunc++;
1405
1419
 
1406
1420
        return (0);