search for: startloc

Displaying 20 results from an estimated 24 matches for "startloc".

2020 Mar 28
0
[klibc:update-dash] dash: expand: Do not reprocess data when expanding words
...har *p, int flag) +static char *argstr(char *p, int flag) { static const char spclchars[] = { '=', @@ -243,6 +240,7 @@ argstr(char *p, int flag) CTLESC, CTLVAR, CTLBACKQ, + CTLARI, CTLENDARI, 0 }; @@ -253,35 +251,41 @@ argstr(char *p, int flag) size_t length; int startloc; - if (!(flag & EXP_VARTILDE)) { - reject += 2; - } else if (flag & EXP_VARTILDE2) { - reject++; - } + reject += !!(flag & EXP_VARTILDE2); + reject += flag & EXP_VARTILDE ? 0 : 2; inquotes = 0; length = 0; if (flag & EXP_TILDE) { - char *q; - flag &= ~EXP_TILDE...
2019 Jan 25
0
[klibc:update-dash] [EXPAND] Do not split quoted VSLENGTH and VSTRIM
...+++ 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; - } - if (easy) + if (varlen >= 0) goto record; -...
2020 Mar 28
0
[klibc:update-dash] dash: [EXPAND] Do not split quoted VSLENGTH and VSTRIM
...+++ 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; - } - if (easy) + if (varlen >= 0) goto record; -...
2006 Feb 28
1
Validate two fields so they do not match
Hey all, I have two form fields (select dropdowns) that are ''startlocation'' and ''endlocation''. These two cannot be equal to each other on save and I am wondering how to put validation into the model for this. Is is possible to do it in the model, or do I need to do this in the controller? Thanks in advance! Ryan -- Ryan Prins rprins@gmai...
2019 Jan 25
0
[klibc:update-dash] [EXPAND] Optimise nulonly away and just use quoted as before
...size_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 = expdest - (char *)stackblock(); p = strchr(p, '=') + 1; again: - varlen = varvalue(var, varflags, flag, &nulonly); + varlen = varvalue(var, varflags, flag, &quoted); if (varflags & VSNUL) varlen--; @@ -783,7 +781,7 @@ vsplus: record: if (!easy) goto end; -...
2020 Mar 28
0
[klibc:update-dash] dash: [EXPAND] Optimise nulonly away and just use quoted as before
...size_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 = expdest - (char *)stackblock(); p = strchr(p, '=') + 1; again: - varlen = varvalue(var, varflags, flag, &nulonly); + varlen = varvalue(var, varflags, flag, &quoted); if (varflags & VSNUL) varlen--; @@ -783,7 +781,7 @@ vsplus: record: if (!easy) goto end; -...
2019 Jan 25
0
[klibc:update-dash] [EXPAND] Split unquoted $@/$* correctly when IFS is set but empty
...size_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 = expdest - (char *)stackblock(); p = strchr(p, '=') + 1; again: - varlen = varvalue(var, varflags, flag); + varlen = varvalue(var, varflags, flag, &nulonly); if (varflags & VSNUL) varlen--; @@ -787,7 +789,7 @@ vsplus: if (!easy) goto end; record: - recordregion...
2020 Mar 28
0
[klibc:update-dash] dash: expand: Fix multiple issues with EXP_DISCARD in evalvar
...dash/expand.c | 30 ++++++++++++++++-------------- 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 */...
2020 Mar 28
0
[klibc:update-dash] dash: [EXPAND] Split unquoted $@/$* correctly when IFS is set but empty
...size_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 = expdest - (char *)stackblock(); p = strchr(p, '=') + 1; again: - varlen = varvalue(var, varflags, flag); + varlen = varvalue(var, varflags, flag, &nulonly); if (varflags & VSNUL) varlen--; @@ -787,7 +789,7 @@ vsplus: if (!easy) goto end; record: - recordregion...
2019 Jan 25
0
[klibc:update-dash] expand: Fix ghost fields with unquoted $@/$*
...ar *, size_t, const 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, ...
2020 Mar 28
0
[klibc:update-dash] dash: expand: Fix ghost fields with unquoted $@/$*
...ar *, size_t, const 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, ...
2019 Jan 25
0
[klibc:update-dash] [EXPAND] Propagate EXP_QPAT in subevalvar
....uk> --- usr/dash/expand.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr/dash/expand.c b/usr/dash/expand.c index 355e924e..c4d52606 100644 --- a/usr/dash/expand.c +++ b/usr/dash/expand.c @@ -650,7 +650,8 @@ subevalvar(char *p, char *str, int strloc, int subtype, int startloc, int varfla char *(*scan)(char *, char *, char *, char *, int , int); argstr(p, EXP_TILDE | (subtype != VSASSIGN && subtype != VSQUESTION ? - (flag & EXP_QUOTED ? EXP_QPAT : EXP_CASE) : 0)); + (flag & (EXP_QUOTED | EXP_QPAT) ? + EXP_QPAT : EXP_CASE)...
2020 Mar 28
0
[klibc:update-dash] dash: [EXPAND] Propagate EXP_QPAT in subevalvar
....uk> --- usr/dash/expand.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr/dash/expand.c b/usr/dash/expand.c index 355e924e..c4d52606 100644 --- a/usr/dash/expand.c +++ b/usr/dash/expand.c @@ -650,7 +650,8 @@ subevalvar(char *p, char *str, int strloc, int subtype, int startloc, int varfla char *(*scan)(char *, char *, char *, char *, int , int); argstr(p, EXP_TILDE | (subtype != VSASSIGN && subtype != VSQUESTION ? - (flag & EXP_QUOTED ? EXP_QPAT : EXP_CASE) : 0)); + (flag & (EXP_QUOTED | EXP_QPAT) ? + EXP_QPAT : EXP_CASE)...
2020 Mar 28
0
[klibc:update-dash] dash: expand: Fix double-decrement in argstr
...c @@ -285,7 +285,7 @@ start: q = stnputs(p, length, expdest); q[-1] &= end - 1; expdest = q - (flag & EXP_WORD ? end : 0); - newloc = expdest - (char *)stackblock() - end; + newloc = q - (char *)stackblock() - end; if (breakall && !inquotes && newloc > startloc) { recordregion(startloc, newloc, 0); }
2006 Mar 02
3
validates_uniqeness_of
Hello, I am trying to understand usage of validates_uniqeness_of. Say I have, two column ''name'' and ''email'' in my table users three unique key is possible for these two columns 1. name 2. email 3. name and email together My question is, if I write validates_uniqueness_of :name, :email what uniqueness is it going to apply, 1 and 2 or, 3 ? Thanks, Mohammad
2019 Jan 25
0
[klibc:update-dash] parser: Add syntax stack for recursive parsing
...P 0x10 /* Malloc strings instead of stalloc */ /* Add CTLESC when necessary. */ -#define QUOTES_ESC (EXP_FULL | EXP_CASE | EXP_QPAT) +#define QUOTES_ESC (EXP_FULL | EXP_CASE) /* Do not skip NUL characters. */ #define QUOTES_KEEPNUL EXP_TILDE @@ -335,16 +335,6 @@ addquote: case CTLESC: startloc++; length++; - - /* - * Quoted parameter expansion pattern: remove quote - * unless inside inner quotes or we have a literal - * backslash. - */ - if (((flag | inquotes) & (EXP_QPAT | EXP_QUOTED)) == - EXP_QPAT && *p != '\\') - break; - goto addq...
2020 Mar 28
0
[klibc:update-dash] dash: parser: Add syntax stack for recursive parsing
...P 0x10 /* Malloc strings instead of stalloc */ /* Add CTLESC when necessary. */ -#define QUOTES_ESC (EXP_FULL | EXP_CASE | EXP_QPAT) +#define QUOTES_ESC (EXP_FULL | EXP_CASE) /* Do not skip NUL characters. */ #define QUOTES_KEEPNUL EXP_TILDE @@ -335,16 +335,6 @@ addquote: case CTLESC: startloc++; length++; - - /* - * Quoted parameter expansion pattern: remove quote - * unless inside inner quotes or we have a literal - * backslash. - */ - if (((flag | inquotes) & (EXP_QPAT | EXP_QUOTED)) == - EXP_QPAT && *p != '\\') - break; - goto addq...
2020 Mar 28
0
[klibc:update-dash] dash: expand: Fix trailing newlines processing in backquote expanding
.../usr/dash/expand.c index 562a4869..175f037b 100644 --- a/usr/dash/expand.c +++ b/usr/dash/expand.c @@ -525,7 +525,7 @@ read: /* Eat all trailing newlines */ dest = expdest; - for (; dest > (char *)stackblock() && dest[-1] == '\n';) + for (; dest > ((char *)stackblock() + startloc) && dest[-1] == '\n';) STUNPUTC(dest); expdest = dest;
2020 Mar 28
0
[klibc:update-dash] dash: expand: Merge syntax/quotes in memtodest with flags
...flag & QUOTES_ESC; name = p + 1; @@ -388,7 +385,7 @@ done: if (!home) goto lose; *p = c; - strtodest(home, SQSYNTAX, quotes); + strtodest(home, flag | EXP_QUOTED); return (p); lose: *p = c; @@ -513,7 +510,6 @@ expbackq(union node *cmd, int flag) char *p; char *dest; int startloc; - char const *syntax = flag & EXP_QUOTED ? DQSYNTAX : BASESYNTAX; struct stackmark smark; INTOFF; @@ -527,7 +523,7 @@ expbackq(union node *cmd, int flag) if (i == 0) goto read; for (;;) { - memtodest(p, i, syntax, flag & QUOTES_ESC); + memtodest(p, i, flag); read: if (in...
2019 Jan 25
0
[klibc:update-dash] builtin: Fix handling of trailing IFS white spaces
...gth of the string */ - offset = sl->text - s; - remainder = backup + offset; - rmescapes(remainder); - setvar(*ap, remainder, 0); - - return; - } - /* set variable to field */ rmescapes(sl->text); setvar(*ap, sl->text, 0); @@ -266,7 +244,7 @@ start: out: recordregion(startloc, p - (char *)stackblock(), 0); STACKSTRNUL(p); - readcmd_handle_line(p + 1, ap); + readcmd_handle_line(p + 1, argc - (ap - argv), ap); return status; }