From 12eb367fce23b66adaced5540226aaf295133a66 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ale=C5=A1=20K=C5=99enek?= Date: Tue, 20 Feb 2007 21:31:40 +0000 Subject: [PATCH] insert tag-originated attributes correctly --- org.glite.jp.primary/src/attrs.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/org.glite.jp.primary/src/attrs.c b/org.glite.jp.primary/src/attrs.c index cfdf91a..d2f5a1d 100644 --- a/org.glite.jp.primary/src/attrs.c +++ b/org.glite.jp.primary/src/attrs.c @@ -10,6 +10,7 @@ #include "feed.h" #include "backend.h" #include "attrs.h" +#include "utils.h" #include "file_plugin.h" #include "builtin_plugins.h" @@ -103,7 +104,7 @@ void process_files(glite_jp_context_t ctx, const char *job, glite_jp_attrval_t** glite_jpps_get_attrs(glite_jp_context_t ctx,const char *job,char **attr,int nattr,glite_jp_attrval_t **attrs_out) { - glite_jp_attrval_t *meta = NULL,*out = NULL; + glite_jp_attrval_t *meta = NULL,*out = NULL,*tag_out; char const **other = NULL; int i,j,nmeta,nother,err = 0,nout = 0; @@ -136,8 +137,13 @@ glite_jpps_get_attrs(glite_jp_context_t ctx,const char *job,char **attr,int natt int k, l, m; void* beh; for (i = 0; i < nother; i++){ - if (! glite_jppsbe_read_tag(ctx, job, other[i], &out)) - nout++; + if (! glite_jppsbe_read_tag(ctx, job, other[i], &tag_out)) { + for (j=0; tag_out[j].name; j++); + out = realloc(out,(nout+j) * sizeof *out); + memcpy(out+nout,tag_out,j * sizeof *out); + nout += j; + free(tag_out); tag_out = NULL; + } for (j = 0; known_namespaces[j].namespace; j++) { void* ph; char* attr_namespace = glite_jpps_get_namespace(other[i]); -- 1.8.2.3