diff options
| author | Junio C Hamano <gitster@pobox.com> | 2013-12-17 11:47:35 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2013-12-17 12:02:44 -0800 |
| commit | ad7044857660af7ffaaf8fbbccc77b817d1b938f (patch) | |
| tree | b77a7390dbbc1901e13d74c1738f327e5fa8154d /test-line-buffer.c | |
| parent | 14a9c5f261bcc436b80700076257f02af0beec68 (diff) | |
| parent | 59556548230e617b837343c2c07e357e688e2ca4 (diff) | |
| download | git-ad7044857660af7ffaaf8fbbccc77b817d1b938f.tar.gz | |
Merge branch 'cc/starts-n-ends-with'
Remove a few duplicate implementations of prefix/suffix comparison
functions, and rename them to starts_with and ends_with.
* cc/starts-n-ends-with:
replace {pre,suf}fixcmp() with {starts,ends}_with()
strbuf: introduce starts_with() and ends_with()
builtin/remote: remove postfixcmp() and use suffixcmp() instead
environment: normalize use of prefixcmp() by removing " != 0"
Diffstat (limited to 'test-line-buffer.c')
| -rw-r--r-- | test-line-buffer.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/test-line-buffer.c b/test-line-buffer.c index ef1d7bae14..1e58f0476f 100644 --- a/test-line-buffer.c +++ b/test-line-buffer.c @@ -19,7 +19,7 @@ static void handle_command(const char *command, const char *arg, struct line_buf { switch (*command) { case 'b': - if (!prefixcmp(command, "binary ")) { + if (starts_with(command, "binary ")) { struct strbuf sb = STRBUF_INIT; strbuf_addch(&sb, '>'); buffer_read_binary(buf, &sb, strtouint32(arg)); @@ -28,12 +28,12 @@ static void handle_command(const char *command, const char *arg, struct line_buf return; } case 'c': - if (!prefixcmp(command, "copy ")) { + if (starts_with(command, "copy ")) { buffer_copy_bytes(buf, strtouint32(arg)); return; } case 's': - if (!prefixcmp(command, "skip ")) { + if (starts_with(command, "skip ")) { buffer_skip_bytes(buf, strtouint32(arg)); return; } |
