get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/814342/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 814342,
    "url": "http://patchwork.ozlabs.org/api/patches/814342/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/286201ef5be4f48110b8ec6ed02b12f01315333d.1505494668.git.msuchanek@suse.de/",
    "project": {
        "id": 2,
        "url": "http://patchwork.ozlabs.org/api/projects/2/?format=api",
        "name": "Linux PPC development",
        "link_name": "linuxppc-dev",
        "list_id": "linuxppc-dev.lists.ozlabs.org",
        "list_email": "linuxppc-dev@lists.ozlabs.org",
        "web_url": "https://github.com/linuxppc/wiki/wiki",
        "scm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git",
        "webscm_url": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/",
        "list_archive_url": "https://lore.kernel.org/linuxppc-dev/",
        "list_archive_url_format": "https://lore.kernel.org/linuxppc-dev/{}/",
        "commit_url_format": "https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git/commit/?id={}"
    },
    "msgid": "<286201ef5be4f48110b8ec6ed02b12f01315333d.1505494668.git.msuchanek@suse.de>",
    "list_archive_url": "https://lore.kernel.org/linuxppc-dev/286201ef5be4f48110b8ec6ed02b12f01315333d.1505494668.git.msuchanek@suse.de/",
    "date": "2017-09-15T17:02:50",
    "name": "[5/6] lib/cmdline.c: Implement single quotes in commandline argument parsing",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "f1cd1b191bb6fa7b04a0c4e0be2bdeddd6edcafc",
    "submitter": {
        "id": 70348,
        "url": "http://patchwork.ozlabs.org/api/people/70348/?format=api",
        "name": "Michal Suchánek",
        "email": "msuchanek@suse.de"
    },
    "delegate": null,
    "mbox": "http://patchwork.ozlabs.org/project/linuxppc-dev/patch/286201ef5be4f48110b8ec6ed02b12f01315333d.1505494668.git.msuchanek@suse.de/mbox/",
    "series": [
        {
            "id": 3338,
            "url": "http://patchwork.ozlabs.org/api/series/3338/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/linuxppc-dev/list/?series=3338",
            "date": "2017-09-15T17:02:47",
            "name": "[1/6] lib/cmdline.c: Add backslash support to kernel commandline parsing.",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/3338/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/814342/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/814342/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>",
        "X-Original-To": [
            "patchwork-incoming@ozlabs.org",
            "linuxppc-dev@lists.ozlabs.org"
        ],
        "Delivered-To": [
            "patchwork-incoming@ozlabs.org",
            "linuxppc-dev@lists.ozlabs.org"
        ],
        "Received": [
            "from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68])\n\t(using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xv23J3Hq2z9rvt\n\tfor <patchwork-incoming@ozlabs.org>;\n\tSat, 16 Sep 2017 03:10:36 +1000 (AEST)",
            "from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3])\n\tby lists.ozlabs.org (Postfix) with ESMTP id 3xv23J2KnPzDrby\n\tfor <patchwork-incoming@ozlabs.org>;\n\tSat, 16 Sep 2017 03:10:36 +1000 (AEST)",
            "from mx1.suse.de (mx2.suse.de [195.135.220.15])\n\t(using TLSv1 with cipher ADH-CAMELLIA256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby lists.ozlabs.org (Postfix) with ESMTPS id 3xv1tg1T4DzDrZX\n\tfor <linuxppc-dev@lists.ozlabs.org>;\n\tSat, 16 Sep 2017 03:03:07 +1000 (AEST)",
            "from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254])\n\tby mx1.suse.de (Postfix) with ESMTP id 6C61B5CB19;\n\tFri, 15 Sep 2017 17:03:01 +0000 (UTC)"
        ],
        "Authentication-Results": "ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=suse.de\n\t(client-ip=195.135.220.15; helo=mx1.suse.de;\n\tenvelope-from=msuchanek@suse.de; receiver=<UNKNOWN>)",
        "X-Virus-Scanned": "by amavisd-new at test-mx.suse.de",
        "X-Amavis-Alert": "BAD HEADER SECTION, Duplicate header field: \"References\"",
        "From": "Michal Suchanek <msuchanek@suse.de>",
        "To": "Jonathan Corbet <corbet@lwn.net>,\n\tBenjamin Herrenschmidt <benh@kernel.crashing.org>,\n\tPaul Mackerras <paulus@samba.org>,\n\tMichael Ellerman <mpe@ellerman.id.au>, \n\tMauro Carvalho Chehab <mchehab@kernel.org>,\n\tJani Nikula <jani.nikula@intel.com>,\n\tMichal Suchanek <msuchanek@suse.de>, \n\tKamlakant Patel <kamlakant.patel@broadcom.com>,\n\tBamvor Jian Zhang <bamvor.zhangjian@linaro.org>,\n\tTamara Diaconita <diaconitatamara@gmail.com>,\n\tTrond Myklebust <trond.myklebust@primarydata.com>,\n\tHari Bathini <hbathini@linux.vnet.ibm.com>,\n\tMahesh Salgaonkar <mahesh@linux.vnet.ibm.com>,\n\tAndrew Morton <akpm@linux-foundation.org>,\n\tNicholas Piggin <npiggin@gmail.com>, Baoquan He <bhe@redhat.com>,\n\tIlya Matveychikov <matvejchikov@gmail.com>,\n\tIngo Molnar <mingo@kernel.org>, \n\tlinux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,\n\tlinuxppc-dev@lists.ozlabs.org",
        "Subject": "[PATCH 5/6] lib/cmdline.c: Implement single quotes in commandline\n\targument parsing",
        "Date": "Fri, 15 Sep 2017 19:02:50 +0200",
        "Message-Id": "<286201ef5be4f48110b8ec6ed02b12f01315333d.1505494668.git.msuchanek@suse.de>",
        "X-Mailer": "git-send-email 2.10.2",
        "In-Reply-To": [
            "<28da60231eb848981e858fa33e3b7e33f8547111.1505494668.git.msuchanek@suse.de>",
            "<4fabdf584ad18d6aae61e331f783a5020567f634.1505231820.git.msuchanek@suse.de>"
        ],
        "References": [
            "<28da60231eb848981e858fa33e3b7e33f8547111.1505494668.git.msuchanek@suse.de>",
            "<4fabdf584ad18d6aae61e331f783a5020567f634.1505231820.git.msuchanek@suse.de>"
        ],
        "X-BeenThere": "linuxppc-dev@lists.ozlabs.org",
        "X-Mailman-Version": "2.1.24",
        "Precedence": "list",
        "List-Id": "Linux on PowerPC Developers Mail List\n\t<linuxppc-dev.lists.ozlabs.org>",
        "List-Unsubscribe": "<https://lists.ozlabs.org/options/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=unsubscribe>",
        "List-Archive": "<http://lists.ozlabs.org/pipermail/linuxppc-dev/>",
        "List-Post": "<mailto:linuxppc-dev@lists.ozlabs.org>",
        "List-Help": "<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=help>",
        "List-Subscribe": "<https://lists.ozlabs.org/listinfo/linuxppc-dev>,\n\t<mailto:linuxppc-dev-request@lists.ozlabs.org?subject=subscribe>",
        "Errors-To": "linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org",
        "Sender": "\"Linuxppc-dev\"\n\t<linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org>"
    },
    "content": "This brings the kernel parser about on par with bourne shell, grub, and\nother tools that chew the arguments before kernel does.\n\nThis should make it easier to deal with multiple levels of\nnesting/quoting. With same quoting grammar on each level there is less\nroom for confusion.\n\nSigned-off-by: Michal Suchanek <msuchanek@suse.de>\n---\n lib/cmdline.c | 29 ++++++++++++++++++++---------\n 1 file changed, 20 insertions(+), 9 deletions(-)",
    "diff": "diff --git a/lib/cmdline.c b/lib/cmdline.c\nindex d98bdc017545..c5335a79a177 100644\n--- a/lib/cmdline.c\n+++ b/lib/cmdline.c\n@@ -191,34 +191,45 @@ bool parse_option_str(const char *str, const char *option)\n \treturn false;\n }\n \n+#define squash_char { \\\n+\tmemmove(args + 1, args, i); \\\n+\targs++; \\\n+\ti--; \\\n+}\n+\n /*\n  * Parse a string to get a param value pair.\n- * You can use \" around spaces, and you can escape with \\\n+ * You can use \" or ' around spaces, and you can escape with \\\n  * Hyphens and underscores equivalent in parameter names.\n  */\n char *next_arg(char *args, char **param, char **val)\n {\n \tunsigned int i, equals = 0;\n-\tint in_quote = 0, backslash = 0;\n+\tint in_quote = 0, backslash = 0, in_single = 0;\n \tchar *next;\n \n \tfor (i = 0; args[i]; i++) {\n-\t\tif (isspace(args[i]) && !in_quote && !backslash)\n+\t\tif (isspace(args[i]) && !in_quote && !backslash && !in_single)\n \t\t\tbreak;\n \n \t\tif ((equals == 0) && (args[i] == '='))\n \t\t\tequals = i;\n \n-\t\tif (!backslash) {\n-\t\t\tif ((args[i] == '\"') || (args[i] == '\\\\')) {\n+\t\tif (in_single) {\n+\t\t\tif (args[i] == '\\'') {\n+\t\t\t\tin_single = 0;\n+\t\t\t\tsquash_char;\n+\t\t\t}\n+\t\t} else if (!backslash) {\n+\t\t\tif ((args[i] == '\"') || (args[i] == '\\\\') ||\n+\t\t\t\t\t(args[i] == '\\'')) {\n \t\t\t\tif (args[i] == '\"')\n \t\t\t\t\tin_quote = !in_quote;\n \t\t\t\tif (args[i] == '\\\\')\n \t\t\t\t\tbackslash = 1;\n-\n-\t\t\t\tmemmove(args + 1, args, i);\n-\t\t\t\targs++;\n-\t\t\t\ti--;\n+\t\t\t\tif (args[i] == '\\'')\n+\t\t\t\t\tin_single = 1;\n+\t\t\t\tsquash_char;\n \t\t\t}\n \t\t} else {\n \t\t\tbackslash = 0;\n",
    "prefixes": [
        "5/6"
    ]
}