Mercurial > vim
view src/po/sjiscorr.c @ 34639:ceee63c7f7aa v9.1.0205
patch 9.1.0205: Cannot use modifiers before :-Ntabmove
Commit: https://github.com/vim/vim/commit/076faac5378cf517baa8c331c57488d39efadec0
Author: zeertzjq <zeertzjq@outlook.com>
Date: Mon Mar 25 16:41:06 2024 +0100
patch 9.1.0205: Cannot use modifiers before :-Ntabmove
Problem: Cannot use modifiers before :-Ntabmove.
Solution: Check backwards from the command instead of checking from the
start of the command line. Slightly adjust docs to make them
more consistent (zeertzjq).
closes: #14289
Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Mon, 25 Mar 2024 16:45:06 +0100 |
parents | 45c0a5330758 |
children |
line wrap: on
line source
/* * Simplistic program to correct SJIS inside strings. When a trail byte is a * backslash it needs to be doubled. * Public domain. */ #include <stdio.h> #include <string.h> int main(int argc, char **argv) { char buffer[BUFSIZ]; char *p; while (fgets(buffer, BUFSIZ, stdin) != NULL) { for (p = buffer; *p != 0; p++) { if (strncmp(p, "charset=utf-8", 13) == 0 || strncmp(p, "charset=UTF-8", 13) == 0) { fputs("charset=CP932", stdout); p += 12; } else if (strncmp(p, "# Original translations", 23) == 0) { fputs("# Generated from ja.po, DO NOT EDIT.", stdout); while (p[1] != '\n') ++p; } else if (*(unsigned char *)p == 0x81 && p[1] == '_') { putchar('\\'); ++p; } else { if (*p & 0x80) { putchar(*p++); if (*p == '\\') putchar(*p); } putchar(*p); } } } }