search for: strchrnul

Displaying 20 results from an estimated 153 matches for "strchrnul".

2016 Jul 26
1
[PATCH] daemon: lvm: change the separator character to '\r'
...ountable (mountable_t *mountable) pr " fprintf (stderr, \"%%s: failed: string finished early, around token %%s\\n\", __func__, \"%s\");\n" name; pr " return -1;\n"; pr " }\n"; - pr " p = strchrnul (tok, ':');\n"; + pr " p = strchrnul (tok, '\\r');\n"; pr " if (*p) next = p+1; else next = NULL;\n"; pr " *p = '\\0';\n"; (match coltype with @@ -633,7 +633,7 @@ cleanup_free_mountable (...
2019 Jan 25
0
[klibc:update-dash] builtin: Fix echo performance regression
...+ len = q - p; + total = len - 1; + + if (f[1] == 's') + goto easy; - p = makestrspace(len, p); - memset(p, 'X', len - 1); - p[len - 1] = 0; + p = makestrspace(len, q); + memset(p, 'X', total); + p[total] = 0; q = stackblock(); total = ASPF(&p, f, p); len = strchrnul(p, 'X') - p; - memcpy(p + len, q, strchrnul(p + len, ' ') - (p + len)); + memcpy(p + len, q, strspn(p + len, "X")); +easy: out1mem(p, total); popstackmark(&smark);
2020 Mar 28
0
[klibc:update-dash] dash: builtin: Fix echo performance regression
...+ len = q - p; + total = len - 1; + + if (f[1] == 's') + goto easy; - p = makestrspace(len, p); - memset(p, 'X', len - 1); - p[len - 1] = 0; + p = makestrspace(len, q); + memset(p, 'X', total); + p[total] = 0; q = stackblock(); total = ASPF(&p, f, p); len = strchrnul(p, 'X') - p; - memcpy(p + len, q, strchrnul(p + len, ' ') - (p + len)); + memcpy(p + len, q, strspn(p + len, "X")); +easy: out1mem(p, total); popstackmark(&smark);
2015 Nov 10
0
[PATCH] daemon: lvm: Change the separator character to ':'.
...ountable (mountable_t *mountable) pr " fprintf (stderr, \"%%s: failed: string finished early, around token %%s\\n\", __func__, \"%s\");\n" name; pr " return -1;\n"; pr " }\n"; - pr " p = strchrnul (tok, ',');\n"; + pr " p = strchrnul (tok, ':');\n"; pr " if (*p) next = p+1; else next = NULL;\n"; pr " *p = '\\0';\n"; (match coltype with @@ -631,7 +631,7 @@ cleanup_free_mountable (mo...
2014 Nov 21
3
Re: [PATCH 6/6] New API: btrfs_subvolume_show
...(*p) { > + /* leading spaces and tabs */ > + while (*p && c_isspace (*p)) p++; Properly indent such lines, so: while (*p && c_isspace (*p)) p++; (also, a minor optimization is to use ++p instead of p++, as it can avoid a temporary value) > + > + pend = strchrnul (p, '\n'); > + if (*pend == '\n') { > + *pend = '\0'; > + pend++; > + } > + > + if (!*p) continue; > + > + colon = strchr (p, ':'); > + if (colon) { > + *colon = '\0'; > + > + /* snapshot...
2014 Nov 21
0
[PATCH 6/6] New API: btrfs_subvolume_show
...trdup("path")) == -1) { + return NULL; + } + if (add_string (&ret, out) == -1) { + return NULL; + } + + /* Read the lines and split into "key: value". */ + while (*p) { + /* leading spaces and tabs */ + while (*p && c_isspace (*p)) p++; + + pend = strchrnul (p, '\n'); + if (*pend == '\n') { + *pend = '\0'; + pend++; + } + + if (!*p) continue; + + colon = strchr (p, ':'); + if (colon) { + *colon = '\0'; + + /* snapshot is special, see the output above */ + if (strncmp(p, &q...
2009 Aug 24
5
[0/5] guestfish: detect stdout-write failure
Nearly any program that writes to standard output can benefit from this sort of fix. Without it, running e.g., ./guestfish --version > /dev/full would exit successfully, even though it got ENOSPC when writing to the full device. That means regular output redirected to a file on a full partition may also fail to be written, and the error ignored. Before: $ guestfish --version >
2014 Nov 24
0
Re: [PATCH 6/6] New API: btrfs_subvolume_show
...while (*p && c_isspace (*p)) p++; > > Properly indent such lines, so: > while (*p && c_isspace (*p)) > p++; > > (also, a minor optimization is to use ++p instead of p++, as it can > avoid a temporary value) Okay. > > > + > > + pend = strchrnul (p, '\n'); > > + if (*pend == '\n') { > > + *pend = '\0'; > > + pend++; > > + } > > + > > + if (!*p) continue; > > + > > + colon = strchr (p, ':'); > > + if (colon) { > > + *col...
2019 Jan 25
0
[klibc:update-dash] [BUILTIN] Handle embedded NULs correctly in printf
...; + char *p, *q; + int done; + int len; + int total; + + setstackmark(&smark); + done = conv_escape_str(s, &p); + q = stackblock(); + len = p - q; + + p = makestrspace(len, p); + memset(p, 'X', len - 1); + p[len - 1] = 0; + + q = stackblock(); + total = ASPF(&p, f, p); + + len = strchrnul(p, 'X') - p; + memcpy(p + len, q, strchrnul(p + len, ' ') - (p + len)); + + out1mem(p, total); + + popstackmark(&smark); + return done; +} + + int printfcmd(int argc, char *argv[]) { char *fmt; @@ -156,17 +203,14 @@ pc: fmt[1] = 0; switch (ch) { - case 'b'...
2020 Mar 28
0
[klibc:update-dash] dash: [BUILTIN] Handle embedded NULs correctly in printf
...; + char *p, *q; + int done; + int len; + int total; + + setstackmark(&smark); + done = conv_escape_str(s, &p); + q = stackblock(); + len = p - q; + + p = makestrspace(len, p); + memset(p, 'X', len - 1); + p[len - 1] = 0; + + q = stackblock(); + total = ASPF(&p, f, p); + + len = strchrnul(p, 'X') - p; + memcpy(p + len, q, strchrnul(p + len, ' ') - (p + len)); + + out1mem(p, total); + + popstackmark(&smark); + return done; +} + + int printfcmd(int argc, char *argv[]) { char *fmt; @@ -156,17 +203,14 @@ pc: fmt[1] = 0; switch (ch) { - case 'b'...
2010 Dec 07
1
builder-ubuntu libguestfs FAILED build step 4b8f70d46dcfed1489c97f822e263b8615f21ea0
...setsockopt size_max sleep sleep-tests snprintf snprintf-tests socket sockets sockets-tests socklen ssize_t stat stat-tests stat-time stat-time-tests stdbool stdbool-tests stddef stddef-tests stdint stdint-tests stdio stdio-tests stdlib stdlib-tests strchrnul strchrnul-tests strdup-posix streq strerror strerror-tests string string-tests strndup strnlen strnlen1 symlink symlink-tests symlinkat symlinkat-tests sys_ioctl sys_ioctl-tests sys_select sys_select-tests sys_socket sys_socket-tests sys_stat sys_stat-tes...
2010 Dec 07
0
builder-ubuntu libguestfs FAILED build step 21810ade12e43fb4d8bfdcefb37a7d8bbe9eef8c
...setsockopt size_max sleep sleep-tests snprintf snprintf-tests socket sockets sockets-tests socklen ssize_t stat stat-tests stat-time stat-time-tests stdbool stdbool-tests stddef stddef-tests stdint stdint-tests stdio stdio-tests stdlib stdlib-tests strchrnul strchrnul-tests strdup-posix streq strerror strerror-tests string string-tests strndup strnlen strnlen1 symlink symlink-tests symlinkat symlinkat-tests sys_ioctl sys_ioctl-tests sys_select sys_select-tests sys_socket sys_socket-tests sys_stat sys_stat-tes...
2011 Jun 21
0
builder-ubuntu libguestfs FAILED build step e1e78bcef5e4654bd2456bd696840329359d35cd
...ntf snprintf-tests socket socketlib sockets sockets-tests socklen ssize_t stat stat-tests stat-time stat-time-tests stdbool stdbool-tests stddef stddef-tests stdint stdint-tests stdio stdio-tests stdlib stdlib-tests strchrnul strchrnul-tests strdup-posix streq strerror strerror-override strerror-tests strerror_r-posix strerror_r-posix-tests string string-tests strndup strnlen strnlen-tests strnlen1 symlink symlink-tests symlinkat symlinkat-tests sys...
2010 Mar 22
1
[PATCH] Mac OS X: Use gnulib setenv module explicitly.
...ives/libguestfs/2010-March/thread.html#00094 --- bootstrap | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/bootstrap b/bootstrap index ce8eeb0..349cf1c 100755 --- a/bootstrap +++ b/bootstrap @@ -76,6 +76,7 @@ maintainer-makefile manywarnings netinet_in progname +setenv strchrnul strerror strndup -- 1.6.4.1
2012 Jul 02
0
[klibc:master] [SHELL] Allow building without LINEO support
...ar(const char *name) struct var *v; if ((v = *findvar(hashvar(name), name)) && !(v->flags & VUNSET)) { +#ifdef WITH_LINENO if (v == &vlineno && v->text == linenovar) { fmtstr(linenovar+7, sizeof(linenovar)-7, "%d", lineno); } +#endif return strchrnul(v->text, '=') + 1; } return NULL; diff --git a/usr/dash/var.h b/usr/dash/var.h index 4c02eb2..1a06a3c 100644 --- a/usr/dash/var.h +++ b/usr/dash/var.h @@ -88,9 +88,15 @@ extern struct var varinit[]; #define vps2 (&vps1)[1] #define vps4 (&vps2)[1] #define voptind (&vps4...
2014 Nov 21
13
[PATCH 0/6] btrfs support part1: subvolume commands
Hi, This is the part1 of improving btrfs support. This series adds missing parameters to btrfs_subvolume_snapshot and btrfs_subvolume_create, and adds two new API btrfs_subvolume_get_default and btrfs_subvolume_show. Other parts will follow. Regards, Hu Hu Tao (6): btrfs: correct words about subvolume and snapshot btrfs: add optional parameter `ro' to btrfs_subvolume_snapshot btrfs:
2014 Nov 24
1
Re: [PATCH 6/6] New API: btrfs_subvolume_show
...p would be at: snapshots/test1 ^- here, while strchr(p, ':') == NULL) would be Other attribute: - ^- here, so skipping all the multi-line value. > > > + while (*p && c_isspace (*p)) p++; > > > + pend = strchrnul (p, '\n'); > > > + if (*pend == '\n') { > > > + *pend = '\0'; > > > + pend++; > > > + } > > > > I see this code repeated already; I think it would be better to > > create> >...
2011 Jan 28
0
builder-ubuntu libguestfs FAILED build step f060d5bcd40b4a6506d7994e67d57dccab1651b8
...setsockopt size_max sleep sleep-tests snprintf snprintf-tests socket sockets sockets-tests socklen ssize_t stat stat-tests stat-time stat-time-tests stdbool stdbool-tests stddef stddef-tests stdint stdint-tests stdio stdio-tests stdlib stdlib-tests strchrnul strchrnul-tests strdup-posix streq strerror strerror-tests string string-tests strndup strnlen strnlen1 symlink symlink-tests symlinkat symlinkat-tests sys_ioctl sys_ioctl-tests sys_select sys_select-tests sys_socket sys_socket-tests sys_stat sys_stat-tes...
2011 Jan 28
1
builder-debian libguestfs FAILED build step 82f5fdb0dbbc0c7b04861edeadf70c86c9342df2
...setsockopt size_max sleep sleep-tests snprintf snprintf-tests socket sockets sockets-tests socklen ssize_t stat stat-tests stat-time stat-time-tests stdbool stdbool-tests stddef stddef-tests stdint stdint-tests stdio stdio-tests stdlib stdlib-tests strchrnul strchrnul-tests strdup-posix streq strerror strerror-tests string string-tests strndup strnlen strnlen1 symlink symlink-tests symlinkat symlinkat-tests sys_ioctl sys_ioctl-tests sys_select sys_select-tests sys_socket sys_socket-tests sys_stat sys_stat-tes...
2010 Dec 14
1
builder-debian libguestfs FAILED build step dec770f171329868081985ca0aa3d52eb3759935
...setsockopt size_max sleep sleep-tests snprintf snprintf-tests socket sockets sockets-tests socklen ssize_t stat stat-tests stat-time stat-time-tests stdbool stdbool-tests stddef stddef-tests stdint stdint-tests stdio stdio-tests stdlib stdlib-tests strchrnul strchrnul-tests strdup-posix streq strerror strerror-tests string string-tests strndup strnlen strnlen1 symlink symlink-tests symlinkat symlinkat-tests sys_ioctl sys_ioctl-tests sys_select sys_select-tests sys_socket sys_socket-tests sys_stat sys_stat-tes...