view src/os_vms_mms.c @ 20595:3609e842f822 v8.2.0851

patch 8.2.0851: can't distinguish <M-a> from accented "a" in the GUI Commit: https://github.com/vim/vim/commit/f4ae6b245a54f11dd967d06b80f30e5abf55fb82 Author: Bram Moolenaar <Bram@vim.org> Date: Sat May 30 19:52:46 2020 +0200 patch 8.2.0851: can't distinguish <M-a> from accented "a" in the GUI Problem: Can't distinguish <M-a> from accented "a" in the GUI. Solution: Use another way to make mapping <C-bslash> work. (closes https://github.com/vim/vim/issues/6163)
author Bram Moolenaar <Bram@vim.org>
date Sat, 30 May 2020 20:00:03 +0200
parents 2463194c8cdd
children
line wrap: on
line source

#include	<stdio.h>
#include	<stdlib.h>
#include	<string.h>
#include	<unixio.h>
#include	"vim.h"
int main(int argc, char *argv[])
{
    FILE	*fpi, *fpo;
    char	cmd[132], buf[BUFSIZ], *argp, *error_file, target[132], *mms;
    int		err = 0, err_line = 0;

    mms = "mms";
    argc--;
    argv++;
    while (argc-- > 0)
    {
	argp = *argv++;
	if (*argp == '-')
	{
	    switch (*++argp)
	    {
		case 'm':
		    mms = ++argp;
		    break;
		case 'e':
		    if (!*(error_file = ++argp))
		    {
			error_file = *argv++;
			argc--;
		    }
		    break;
		default:
		    break;
	    }
	}
	else
	{
	    if (*target)
		strcat(target, " ");
	    strcat(target, argp);
	}
    }
    vim_snprintf(cmd, sizeof(cmd), "%s/output=tmp:errors.vim_tmp %s",
								 mms, target);
    system(cmd);
    fpi = fopen("tmp:errors.vim_tmp", "r");
    fpo = fopen(error_file, "w");
    while (fgets(buf, BUFSIZ, fpi))
    {
	if (!memcmp(buf, "%CC-", 4))
	{
	    err_line++;
	    buf[strlen(buf)-1] = '\0';
	    err++;
	}
	else
	{
	    if (err_line)
	    {
		if (strstr(buf, _("At line")))
		{
		    err_line = 0;
		    fprintf(fpo, "@");
		}
		else
		    buf[strlen(buf)-1] = '\0';
	    }
	}
	fprintf(fpo, "%s", buf);
    }
    fclose(fpi);
    fclose(fpo);
    while (!delete("tmp:errors.vim_tmp"))
	/*nop*/;
    exit(err ? 44 : 1);
    return(0);
}