[SYSTEM] Apply patch from ALTLinux.
authorAlexey Gladkov <legion@altlinux.org>
Sun, 4 Feb 2007 19:59:44 +0000 (22:59 +0300)
committerAlexey Gladkov <legion@altlinux.org>
Sun, 4 Feb 2007 19:59:44 +0000 (22:59 +0300)
Apply kbd-1.12-alt-cleanup.patch patch from ALTLinux distribution.

Signed-off-by: Alexey Gladkov <legion@altlinux.org>
contrib/codepage.c
src/loadkeys.y

index 849d21b..77852bf 100644 (file)
@@ -224,8 +224,8 @@ handle_codepage(int more_to_come) {
        }
        if (optL) {
            int t = CPEntryHeader.device_type;
-           printf("CPEntryHeader: size=%d dev=%d [%s] name=%8.8s \
-codepage=%d\n\t\tres=%6.6s nxt=%ld off_font=%ld\n\n",
+           printf("CPEntryHeader: size=%d dev=%d [%s] name=%8.8s"
+"codepage=%d\n\t\tres=%6.6s nxt=%ld off_font=%ld\n\n",
                   CPEntryHeader.size,
                   t, (t==1) ? "screen" : (t==2) ? "printer" : "?",
                   CPEntryHeader.device_name,
@@ -270,6 +270,10 @@ codepage=%d\n\t\tres=%6.6s nxt=%ld off_font=%ld\n\n",
        if (optc)
          return 0;
 
+        fprintf(stderr,
+               "Warning: CP format is a hack!\n"
+               "The files produced may or may not be usable!\n");
+
        sprintf(outfile, "%d.cp", CPEntryHeader.codepage);
        if ((out = fopen(outfile, "w")) == NULL) {
            printf("\nUnable to open file %s.\n", outfile);
index ab8ad8f..1496874 100644 (file)
@@ -80,10 +80,12 @@ int private_error_ct = 0;
 
 extern int rvalct;
 extern struct kbsentry kbs_buf;
+int yyerror(const char *s);
 extern void lkfatal(const char *s);
 extern void lkfatal1(const char *s, const char *s2);
 
 #include "ksyms.h"
+int yylex (void);
 %}
 
 %%
@@ -1025,18 +1027,21 @@ loadkeys (char *console, int *warned) {
        fd = getfd(console);
        keyct = defkeys(fd, console, &warned);
        funcct = deffuncs(fd);
-       if (accent_table_size > 0 || nocompose)
-               diacct = defdiacs(fd);
        if (verbose) {
                printf(_("\nChanged %d %s and %d %s.\n"),
                       keyct, (keyct == 1) ? _("key") : _("keys"),
                       funcct, (funcct == 1) ? _("string") : _("strings"));
-               if (accent_table_size > 0 || nocompose)
+       }
+       if (accent_table_size > 0 || nocompose) {
+         diacct = defdiacs(fd);
+         if (verbose) {
                        printf(_("Loaded %d compose %s.\n"), diacct,
                               (diacct == 1) ? _("definition") : _("definitions"));
-               else
-                       printf(_("(No change in compose definitions.)\n"));
+         }
        }
+       else
+         if (verbose)
+           printf(_("(No change in compose definitions.)\n"));
 }
 
 static void strings_as_usual(void) {