X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/07c319ec54d6fc778ee3cc5e75a747242006723e..3f87c1c05314e5b35322f86545e495c29d7e3929:/tools/tesh/run_context.c diff --git a/tools/tesh/run_context.c b/tools/tesh/run_context.c index 41af0d5efd..181b688b22 100644 --- a/tools/tesh/run_context.c +++ b/tools/tesh/run_context.c @@ -342,6 +342,9 @@ void rctx_pushline(const char *filepos, char kind, char *line) filepos, rctx->expected_return); } else if (!strncmp(line, "output sort", strlen("output sort"))) { + sort_len = atoi(line + strlen("output sort")); + if (sort_len==0) + sort_len=SORT_LEN_DEFAULT; rctx->output_sort = 1; VERB1("[%s] (sort output of next command)", filepos); @@ -650,7 +653,7 @@ static int cmpstringp(const void *p1, const void *p2) { DEBUG2("Compare strings '%s' and '%s'", s1, s2); - int res = strncmp(s1, s2, 19); + int res = strncmp(s1, s2, sort_len); if (res == 0) return p1>p2; return res; @@ -799,7 +802,6 @@ void *rctx_wait(void *r) xbt_dynar_free(&a); /* If an empty line moved in first position, move it back to the end */ if (rctx->output_got->data[0]=='\n') { - fprintf(stderr,"XXX"); memmove(rctx->output_got->data,rctx->output_got->data+1,rctx->output_got->used-1); rctx->output_got->data[rctx->output_got->used-1] = '\n'; }