search for: varlen

Displaying 20 results from an estimated 33 matches for "varlen".

Did you mean: vallen
2020 Mar 28
0
[klibc:update-dash] dash: expand: Fix multiple issues with EXP_DISCARD in evalvar
...+++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/usr/dash/expand.c b/usr/dash/expand.c index 411381bd..25236c09 100644 --- a/usr/dash/expand.c +++ b/usr/dash/expand.c @@ -698,6 +698,7 @@ evalvar(char *p, int flag) int patloc; int startloc; ssize_t varlen; + int discard; int quoted; varflags = *p++; @@ -713,41 +714,41 @@ again: if (varflags & VSNUL) varlen--; + discard = varlen < 0 ? EXP_DISCARD : 0; + switch (subtype) { case VSPLUS: - varlen = -1 - varlen; + discard ^= EXP_DISCARD; /* fall through */ case 0: case...
2020 Mar 28
0
[klibc:update-dash] dash: expand: Do not reprocess data when expanding words
...t: + amount = loc - expdest; + STADJUST(amount, expdest); + + /* Remove any recorded regions beyond start of variable */ + removerecordregions(startloc); + + return p; } @@ -705,7 +696,6 @@ evalvar(char *p, int flag) int varflags; char *var; int patloc; - int c; int startloc; ssize_t varlen; int quoted; @@ -713,9 +703,6 @@ evalvar(char *p, int flag) varflags = *p++; subtype = varflags & VSTYPE; - if (!subtype) - sh_error("Bad substitution"); - quoted = flag & EXP_QUOTED; var = p; startloc = expdest - (char *)stackblock(); @@ -726,32 +713,30 @@ again:...
2019 Jan 25
0
[klibc:update-dash] [EXPAND] Optimise nulonly away and just use quoted as before
....uk> --- usr/dash/expand.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/usr/dash/expand.c b/usr/dash/expand.c index 9bbd19da..a2f99f14 100644 --- a/usr/dash/expand.c +++ b/usr/dash/expand.c @@ -722,7 +722,6 @@ evalvar(char *p, int flag) ssize_t varlen; int easy; int quoted; - int nulonly; varflags = *p++; subtype = varflags & VSTYPE; @@ -733,12 +732,11 @@ evalvar(char *p, int flag) quoted = flag & EXP_QUOTED; var = p; easy = (!quoted || (*var == '@' && shellparam.nparam)); - nulonly = easy; startloc = ex...
2020 Mar 28
0
[klibc:update-dash] dash: [EXPAND] Optimise nulonly away and just use quoted as before
....uk> --- usr/dash/expand.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/usr/dash/expand.c b/usr/dash/expand.c index 9bbd19da..a2f99f14 100644 --- a/usr/dash/expand.c +++ b/usr/dash/expand.c @@ -722,7 +722,6 @@ evalvar(char *p, int flag) ssize_t varlen; int easy; int quoted; - int nulonly; varflags = *p++; subtype = varflags & VSTYPE; @@ -733,12 +732,11 @@ evalvar(char *p, int flag) quoted = flag & EXP_QUOTED; var = p; easy = (!quoted || (*var == '@' && shellparam.nparam)); - nulonly = easy; startloc = ex...
2019 Jan 25
0
[klibc:update-dash] [EXPAND] Split unquoted $@/$* correctly when IFS is set but empty
...t(const char *, size_t, const char *, int); -STATIC ssize_t varvalue(char *, int, int); +STATIC ssize_t varvalue(char *, int, int, int *); STATIC void expandmeta(struct strlist *, int); #ifdef HAVE_GLOB STATIC void addglob(const glob_t *); @@ -722,6 +722,7 @@ evalvar(char *p, int flag) ssize_t varlen; int easy; int quoted; + int nulonly; varflags = *p++; subtype = varflags & VSTYPE; @@ -732,11 +733,12 @@ evalvar(char *p, int flag) quoted = flag & EXP_QUOTED; var = p; easy = (!quoted || (*var == '@' && shellparam.nparam)); + nulonly = easy; startloc = ex...
2020 Mar 28
0
[klibc:update-dash] dash: [EXPAND] Split unquoted $@/$* correctly when IFS is set but empty
...t(const char *, size_t, const char *, int); -STATIC ssize_t varvalue(char *, int, int); +STATIC ssize_t varvalue(char *, int, int, int *); STATIC void expandmeta(struct strlist *, int); #ifdef HAVE_GLOB STATIC void addglob(const glob_t *); @@ -722,6 +722,7 @@ evalvar(char *p, int flag) ssize_t varlen; int easy; int quoted; + int nulonly; varflags = *p++; subtype = varflags & VSTYPE; @@ -732,11 +733,12 @@ evalvar(char *p, int flag) quoted = flag & EXP_QUOTED; var = p; easy = (!quoted || (*var == '@' && shellparam.nparam)); + nulonly = easy; startloc = ex...
2020 Mar 28
0
[klibc:update-dash] dash: expand: Ensure result is escaped in cvtnum
...result = arith(start); popstackmark(&sm); - len = cvtnum(result); + len = cvtnum(result, flag); if (likely(!(flag & EXP_QUOTED))) recordregion(begoff, begoff + len, 0); @@ -746,7 +746,7 @@ again: if (subtype == VSLENGTH) { if (flag & EXP_DISCARD) return p; - cvtnum(varlen > 0 ? varlen : 0); + cvtnum(varlen > 0 ? varlen : 0, flag); goto record; } @@ -795,15 +795,17 @@ record: * Put a string on the stack. */ -static void memtodest(const char *p, size_t len, int flags) +static size_t memtodest(const char *p, size_t len, int flags) { const char *s...
2019 Jan 25
0
[klibc:update-dash] [EXPAND] Do not split quoted VSLENGTH and VSTRIM
...index add952b7..9bbd19da 100644 --- a/usr/dash/expand.c +++ b/usr/dash/expand.c @@ -753,28 +753,22 @@ vsplus: argstr(p, flag | EXP_TILDE | EXP_WORD); goto end; } - if (easy) - goto record; - goto end; + goto record; } if (subtype == VSASSIGN || subtype == VSQUESTION) { - if (varlen < 0) { - if (subevalvar(p, var, 0, subtype, startloc, - varflags, flag & ~QUOTES_ESC)) { - varflags &= ~VSNUL; - /* - * Remove any recorded regions beyond - * start of variable - */ - removerecordregions(startloc); - goto again; - } - goto end; -...
2020 Mar 28
0
[klibc:update-dash] dash: [EXPAND] Do not split quoted VSLENGTH and VSTRIM
...index add952b7..9bbd19da 100644 --- a/usr/dash/expand.c +++ b/usr/dash/expand.c @@ -753,28 +753,22 @@ vsplus: argstr(p, flag | EXP_TILDE | EXP_WORD); goto end; } - if (easy) - goto record; - goto end; + goto record; } if (subtype == VSASSIGN || subtype == VSQUESTION) { - if (varlen < 0) { - if (subevalvar(p, var, 0, subtype, startloc, - varflags, flag & ~QUOTES_ESC)) { - varflags &= ~VSNUL; - /* - * Remove any recorded regions beyond - * start of variable - */ - removerecordregions(startloc); - goto again; - } - goto end; -...
2019 Jan 25
0
[klibc:update-dash] expand: Fix ghost fields with unquoted $@/$*
...char *, int); -STATIC ssize_t varvalue(char *, int, int, int *); +STATIC ssize_t varvalue(char *, int, int, int); STATIC void expandmeta(struct strlist *, int); #ifdef HAVE_GLOB STATIC void addglob(const glob_t *); @@ -712,7 +712,6 @@ evalvar(char *p, int flag) int c; int startloc; ssize_t varlen; - int easy; int quoted; varflags = *p++; @@ -723,12 +722,11 @@ evalvar(char *p, int flag) quoted = flag & EXP_QUOTED; var = p; - easy = (!quoted || (*var == '@' && shellparam.nparam)); startloc = expdest - (char *)stackblock(); p = strchr(p, '=') + 1;...
2020 Mar 28
0
[klibc:update-dash] dash: expand: Fix ghost fields with unquoted $@/$*
...char *, int); -STATIC ssize_t varvalue(char *, int, int, int *); +STATIC ssize_t varvalue(char *, int, int, int); STATIC void expandmeta(struct strlist *, int); #ifdef HAVE_GLOB STATIC void addglob(const glob_t *); @@ -712,7 +712,6 @@ evalvar(char *p, int flag) int c; int startloc; ssize_t varlen; - int easy; int quoted; varflags = *p++; @@ -723,12 +722,11 @@ evalvar(char *p, int flag) quoted = flag & EXP_QUOTED; var = p; - easy = (!quoted || (*var == '@' && shellparam.nparam)); startloc = expdest - (char *)stackblock(); p = strchr(p, '=') + 1;...
2020 Mar 28
0
[klibc:update-dash] dash: expand: Eat closing brace for length parameter expansion
...ged, 1 insertion(+) diff --git a/usr/dash/expand.c b/usr/dash/expand.c index 25236c09..20362cef 100644 --- a/usr/dash/expand.c +++ b/usr/dash/expand.c @@ -745,6 +745,7 @@ again: varunset(p, var, 0, 0); if (subtype == VSLENGTH) { + p++; if (flag & EXP_DISCARD) return p; cvtnum(varlen > 0 ? varlen : 0, flag);
1999 Jan 02
3
.C
...are known. The appended example works in S+ using the pointers= argument in .C. Is there a way to do this in R? Thanks...Steve Oncley oncley@ucar.edu C-code: void inquire_varid( int *ncid_p, /* NetCDF file id. File is left open */ int *var_id_p, /* variable id */ long **varlen, /* Length of variable, along each dimension */ long *ndims_r, /* number of dimensions in variable */ /* This argument is created automatically by S+'s .C for pointers=T variables */ char **vartype) /* character string describing S object type */ { ... *varlen...
2020 Mar 28
0
[klibc:update-dash] dash: expand: Fix skipping of command substitution when trimming in evalvar
...ff-by: Ben Hutchings <ben at decadent.org.uk> --- usr/dash/expand.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/usr/dash/expand.c b/usr/dash/expand.c index a764881e..df226632 100644 --- a/usr/dash/expand.c +++ b/usr/dash/expand.c @@ -805,6 +805,8 @@ record: goto record; } + varlen = 0; + end: if (subtype != VSNORMAL) { /* skip to end of alternative */ int nesting = 1;
2011 Aug 25
2
rpart: plot without scientific notation
While I'm very pleased with the results I get with rpart and rpart.plot, I would like to change the scientific notation of the dependent variable in the plots into integers. Right now all my 5 or more digit numbers are displayed using scientific notation. I managed to find this: http://tolstoy.newcastle.edu.au/R/e8/help/09/12/8423.html but I do not fully understand what to change, and to
2017 May 22
1
[PATCH] vhost: Coalesce vq_err formats, pr_fmt misuse, add missing newlines
...+ vq_err(vq, "Received non zero pi_bytesin, but wrong data_direction\n"); vhost_scsi_send_bad_target(vs, vq, head, out); continue; } @@ -1026,9 +1024,8 @@ vhost_scsi_handle_vq(struct vhost_scsi *vs, struct vhost_virtqueue *vq) * TODO what if cdb was too small for varlen cdb header? */ if (unlikely(scsi_command_size(cdb) > VHOST_SCSI_MAX_CDB_SIZE)) { - vq_err(vq, "Received SCSI CDB with command_size: %d that" - " exceeds SCSI_MAX_VARLEN_CDB_SIZE: %d\n", - scsi_command_size(cdb), VHOST_SCSI_MAX_CDB_SIZE); + vq_err(vq, "Re...
2017 May 22
1
[PATCH] vhost: Coalesce vq_err formats, pr_fmt misuse, add missing newlines
...+ vq_err(vq, "Received non zero pi_bytesin, but wrong data_direction\n"); vhost_scsi_send_bad_target(vs, vq, head, out); continue; } @@ -1026,9 +1024,8 @@ vhost_scsi_handle_vq(struct vhost_scsi *vs, struct vhost_virtqueue *vq) * TODO what if cdb was too small for varlen cdb header? */ if (unlikely(scsi_command_size(cdb) > VHOST_SCSI_MAX_CDB_SIZE)) { - vq_err(vq, "Received SCSI CDB with command_size: %d that" - " exceeds SCSI_MAX_VARLEN_CDB_SIZE: %d\n", - scsi_command_size(cdb), VHOST_SCSI_MAX_CDB_SIZE); + vq_err(vq, "Re...
2013 Mar 15
0
Wine release 1.5.26
...inetcomm: Use a static interface instance for IMimeAllocator. inetcomm: COM cleanup for the IMimeBody iface. inetcomm: Include the object instead of IMimeBody in struct body_t. inetcomm: COM cleanup for the IStream iface. mpr: Use offsetof for the size of structs with varlen arrays. avifil32: COM cleanup for the IAVIFile iface. avifil32: Merge and cleanup the IPersistFile iface. avifil32: Avoid forward declaration of IAVIFile/IPersistFile methods. avifil32: Support COM aggregation for AVIFile. avifil32/tests: Add COM tests for AVIFile....
2012 Jul 26
2
[RFC-v5] tcm_vhost: Initial merge for vhost level target fabric driver
...ed by tcm_vhost_new_cmd_map() and down into + * target_setup_cmd_from_cdb() + */ + memcpy(tv_cmd->tvc_cdb, v_req.cdb, TCM_VHOST_MAX_CDB_SIZE); + /* + * Check that the recieved CDB size does not exceeded our + * hardcoded max for tcm_vhost + */ + /* TODO what if cdb was too small for varlen cdb header? */ + if (unlikely(scsi_command_size(tv_cmd->tvc_cdb) > + TCM_VHOST_MAX_CDB_SIZE)) { + vq_err(vq, "Received SCSI CDB with command_size: %d that" + " exceeds SCSI_MAX_VARLEN_CDB_SIZE: %d\n", + scsi_command_size(tv_cmd->tvc_cdb), + TCM_VHOST_MAX...
2012 Jul 26
2
[RFC-v5] tcm_vhost: Initial merge for vhost level target fabric driver
...ed by tcm_vhost_new_cmd_map() and down into + * target_setup_cmd_from_cdb() + */ + memcpy(tv_cmd->tvc_cdb, v_req.cdb, TCM_VHOST_MAX_CDB_SIZE); + /* + * Check that the recieved CDB size does not exceeded our + * hardcoded max for tcm_vhost + */ + /* TODO what if cdb was too small for varlen cdb header? */ + if (unlikely(scsi_command_size(tv_cmd->tvc_cdb) > + TCM_VHOST_MAX_CDB_SIZE)) { + vq_err(vq, "Received SCSI CDB with command_size: %d that" + " exceeds SCSI_MAX_VARLEN_CDB_SIZE: %d\n", + scsi_command_size(tv_cmd->tvc_cdb), + TCM_VHOST_MAX...