Displaying 14 results from an estimated 14 matches for "lastp".
Did you mean:
last
2008 Oct 08
11
Using image_tag and send_data
I am using image_tag to load an image that I''ve saved to the database
(using attachment_fu if you''re curious but that''s probably not
relevant here):
VIEW
<%= image_tag ''/photo/get_image/5'' %>
CONTROLLER
def get_image
@photo=Photo.find(params[:id])
send_data(DbFile.find(@photo.db_file_id).data,
:type =>
2020 Mar 28
0
[klibc:update-dash] dash: eval: Add assignment built-in support again
..._REGULAR,
};
@@ -648,22 +649,42 @@ out:
result->fd, result->buf, result->nleft, result->jp));
}
-static char **
-parse_command_args(char **argv, const char **path)
+static struct strlist *fill_arglist(struct arglist *arglist,
+ union node **argpp)
{
+ struct strlist **lastp = arglist->lastp;
+ union node *argp;
+
+ while ((argp = *argpp)) {
+ expandarg(argp, arglist, EXP_FULL | EXP_TILDE);
+ *argpp = argp->narg.next;
+ if (*lastp)
+ break;
+ }
+
+ return *lastp;
+}
+
+static int parse_command_args(struct arglist *arglist, union node **argpp,
+ const...
2019 Jan 25
0
[klibc:update-dash] builtin: Fix handling of trailing IFS white spaces
...ool.h>
/*
* Routines to expand arguments to commands. We have to deal with
@@ -203,7 +204,7 @@ expandarg(union node *arg, struct arglist *arglist, int flag)
* TODO - EXP_REDIR
*/
if (flag & EXP_FULL) {
- ifsbreakup(p, &exparg);
+ ifsbreakup(p, -1, &exparg);
*exparg.lastp = NULL;
exparg.lastp = &exparg.list;
expandmeta(exparg.list, flag);
@@ -1016,15 +1017,18 @@ recordregion(int start, int end, int nulonly)
* Break the argument string into pieces based upon IFS and add the
* strings to the argument list. The regions of the string to be
* searched fo...
2020 Mar 28
0
[klibc:update-dash] dash: builtin: Fix handling of trailing IFS white spaces
...ool.h>
/*
* Routines to expand arguments to commands. We have to deal with
@@ -203,7 +204,7 @@ expandarg(union node *arg, struct arglist *arglist, int flag)
* TODO - EXP_REDIR
*/
if (flag & EXP_FULL) {
- ifsbreakup(p, &exparg);
+ ifsbreakup(p, -1, &exparg);
*exparg.lastp = NULL;
exparg.lastp = &exparg.list;
expandmeta(exparg.list, flag);
@@ -1016,15 +1017,18 @@ recordregion(int start, int end, int nulonly)
* Break the argument string into pieces based upon IFS and add the
* strings to the argument list. The regions of the string to be
* searched fo...
2016 Nov 14
0
getGraphicsEvent() alternative for cairo graphics device?
...ing the window or pressing "q" should terminate the
# function, but sometimes Ctrl-C at the prompt is ignored due to the
# system() call.
testIdle2 = function(factor=0.99,theta=0.03) {
n=200;
xform=factor*
rbind(c(cos(theta),-sin(theta)),
c(sin(theta),cos(theta)));
lastp=c(0,0);
ps=matrix(lastp,ncol=2);
# cairo is the flicker-free option for X11
X11(type="cairo");
on.exit(dev.off());
getGraphicsEvent(
onIdle=function() {
plot(ps[,1],ps[,2],
xlim=c(-1,1),ylim=c(-1,1),type="l...
2019 Jan 25
0
[klibc:update-dash] [EVAL] Move common skipcount logic into skiploop
...--skipcount <= 0) {
break;
evaltree(n->nbinary.ch2, flags);
status = exitstatus;
- if (evalskip)
- goto skipping;
- }
+ skip = skiploop();
+ } while (!(skip & ~SKIPCONT));
loopnest--;
exitstatus = status;
}
@@ -392,9 +409,6 @@ evalfor(union node *n, int flags)
arglist.lastp = &arglist.list;
for (argp = n->nfor.args ; argp ; argp = argp->narg.next) {
expandarg(argp, &arglist, EXP_FULL | EXP_TILDE);
- /* XXX */
- if (evalskip)
- goto out;
}
*arglist.lastp = NULL;
@@ -404,18 +418,10 @@ evalfor(union node *n, int flags)
for (sp = arglist.lis...
2020 Mar 28
0
[klibc:update-dash] dash: [EVAL] Move common skipcount logic into skiploop
...--skipcount <= 0) {
break;
evaltree(n->nbinary.ch2, flags);
status = exitstatus;
- if (evalskip)
- goto skipping;
- }
+ skip = skiploop();
+ } while (!(skip & ~SKIPCONT));
loopnest--;
exitstatus = status;
}
@@ -392,9 +409,6 @@ evalfor(union node *n, int flags)
arglist.lastp = &arglist.list;
for (argp = n->nfor.args ; argp ; argp = argp->narg.next) {
expandarg(argp, &arglist, EXP_FULL | EXP_TILDE);
- /* XXX */
- if (evalskip)
- goto out;
}
*arglist.lastp = NULL;
@@ -404,18 +418,10 @@ evalfor(union node *n, int flags)
for (sp = arglist.lis...
2020 Mar 28
0
[klibc:update-dash] dash: eval: avoid leaking memory associated with redirections
...atus;
}
@@ -396,14 +402,12 @@ evalfor(union node *n, int flags)
struct arglist arglist;
union node *argp;
struct strlist *sp;
- struct stackmark smark;
int status;
errlinno = lineno = n->nfor.linno;
if (funcline)
lineno -= funcline - 1;
- setstackmark(&smark);
arglist.lastp = &arglist.list;
for (argp = n->nfor.args ; argp ; argp = argp->narg.next) {
expandarg(argp, &arglist, EXP_FULL | EXP_TILDE);
@@ -420,7 +424,6 @@ evalfor(union node *n, int flags)
break;
}
loopnest--;
- popstackmark(&smark);
return status;
}
@@ -433,14 +436,12 @@...
2016 Nov 14
2
getGraphicsEvent() alternative for cairo graphics device?
Great. Thanks!
Paul
On 14/11/16 13:41, frederik at ofb.net wrote:
> Hi Paul,
>
> Thank you, for some reason I didn't seem to get an email notification
> for your bugzilla comment!
>
> I will try to send you something shortly.
>
> Frederick
>
> On Mon, Nov 14, 2016 at 08:55:20AM +1300, Paul Murrell wrote:
>> Hi
>>
>> The current status is that
2019 Jan 25
0
[klibc:update-dash] eval: Return status in eval functions
...-STATIC void
+STATIC int
evalfor(union node *n, int flags)
{
struct arglist arglist;
union node *argp;
struct strlist *sp;
struct stackmark smark;
+ int status;
errlinno = lineno = n->nfor.linno;
if (funcline)
@@ -414,28 +409,31 @@ evalfor(union node *n, int flags)
}
*arglist.lastp = NULL;
- exitstatus = 0;
+ status = 0;
loopnest++;
flags &= EV_TESTED;
for (sp = arglist.list ; sp ; sp = sp->next) {
setvar(n->nfor.var, sp->text, 0);
- evaltree(n->nfor.body, flags);
+ status = evaltree(n->nfor.body, flags);
if (skiploop() & ~SKIPCONT)...
2020 Mar 28
0
[klibc:update-dash] dash: eval: Return status in eval functions
...-STATIC void
+STATIC int
evalfor(union node *n, int flags)
{
struct arglist arglist;
union node *argp;
struct strlist *sp;
struct stackmark smark;
+ int status;
errlinno = lineno = n->nfor.linno;
if (funcline)
@@ -414,28 +409,31 @@ evalfor(union node *n, int flags)
}
*arglist.lastp = NULL;
- exitstatus = 0;
+ status = 0;
loopnest++;
flags &= EV_TESTED;
for (sp = arglist.list ; sp ; sp = sp->next) {
setvar(n->nfor.var, sp->text, 0);
- evaltree(n->nfor.body, flags);
+ status = evaltree(n->nfor.body, flags);
if (skiploop() & ~SKIPCONT)...
2020 Mar 28
0
[klibc:update-dash] dash: eval: Replace with listsetvar with mklocal/setvareq
...s) {
+ if (unlikely(status)) {
+ vlocal = 0;
bail:
exitstatus = status;
@@ -829,13 +839,19 @@ bail:
goto out;
}
+ if (likely(vlocal))
+ localvar_stop = pushlocalvars();
+
for (argp = cmd->ncmd.assign; argp; argp = argp->narg.next) {
struct strlist **spp;
spp = varlist.lastp;
expandarg(argp, &varlist, EXP_VARTILDE);
- mklocal((*spp)->text);
+ if (vlocal)
+ mklocal((*spp)->text, VEXPORT);
+ else
+ setvareq((*spp)->text, vflags);
}
/* Print the command if xflag is set. */
@@ -857,8 +873,8 @@ bail:
/* Now locate the command. */
if (cmden...
2020 Mar 28
0
[klibc:update-dash] dash: expand: Do not reprocess data when expanding words
...+++++------------------------------
usr/dash/expand.h | 2 +-
2 files changed, 133 insertions(+), 163 deletions(-)
diff --git a/usr/dash/expand.c b/usr/dash/expand.c
index df226632..c3d67fc3 100644
--- a/usr/dash/expand.c
+++ b/usr/dash/expand.c
@@ -110,10 +110,10 @@ static struct ifsregion *ifslastp;
/* holds expanded arg list */
static struct arglist exparg;
-STATIC void argstr(char *, int);
-STATIC char *exptilde(char *, char *, int);
+static char *argstr(char *p, int flag);
+static char *exptilde(char *startp, int flag);
+static char *expari(char *start, int flag);
STATIC void expbackq...
2015 Feb 14
2
[PATCH 0/2] Change guestfs__*
libguestfs has used double and triple underscores in identifiers.
These aren't valid for global names in C++.
(http://stackoverflow.com/a/228797)
These large but completely mechanical patches change the illegal
identifiers to legal ones.
Rich.