From 88cd86be5aaeffb73d6cffb7457cd382c84cbc9d Mon Sep 17 00:00:00 2001 From: Keith Rarick Date: Sun, 28 Feb 2010 22:08:29 -0800 Subject: [PATCH] Allow underscore in tube names. Closes gh-24. --- doc/protocol.txt | 7 ++++--- prot.c | 2 +- sh-tests/allow-underscore.commands | 2 ++ sh-tests/allow-underscore.expected | 1 + 4 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 sh-tests/allow-underscore.commands create mode 100644 sh-tests/allow-underscore.expected diff --git a/doc/protocol.txt b/doc/protocol.txt index 9a94d5f..5c363fc 100644 --- a/doc/protocol.txt +++ b/doc/protocol.txt @@ -12,9 +12,10 @@ nonnegative. Names, in this protocol, are ASCII strings. They may contain letters (A-Z and a-z), numerals (0-9), hyphen ("-"), plus ("+"), slash ("/"), semicolon (";"), -dot ("."), dollar-sign ("$"), and parentheses ("(" and ")"), but they may not -begin with a hyphen. They are terminated by white space (either a space char or -end of line). Each name must be at least one character long. +dot ("."), dollar-sign ("$"), underscore ("_"), and parentheses ("(" and ")"), +but they may not begin with a hyphen. They are terminated by white space +(either a space char or end of line). Each name must be at least one character +long. The protocol contains two kinds of data: text lines and unstructured chunks of data. Text lines are used for client commands and server responses. Chunks are diff --git a/prot.c b/prot.c index b3a3116..bb4eb1a 100644 --- a/prot.c +++ b/prot.c @@ -46,7 +46,7 @@ size_t job_data_size_limit = JOB_DATA_SIZE_LIMIT_DEFAULT; #define NAME_CHARS \ "ABCDEFGHIJKLMNOPQRSTUVWXYZ" \ "abcdefghijklmnopqrstuvwxyz" \ - "0123456789-+/;.$()" + "0123456789-+/;.$_()" #define CMD_PUT "put " #define CMD_PEEKJOB "peek " diff --git a/sh-tests/allow-underscore.commands b/sh-tests/allow-underscore.commands new file mode 100644 index 0000000..3db7d43 --- /dev/null +++ b/sh-tests/allow-underscore.commands @@ -0,0 +1,2 @@ +use x_y +quit diff --git a/sh-tests/allow-underscore.expected b/sh-tests/allow-underscore.expected new file mode 100644 index 0000000..f2e6d93 --- /dev/null +++ b/sh-tests/allow-underscore.expected @@ -0,0 +1 @@ +USING x_y -- 2.11.4.GIT