Replaced some large local variables by other means in xorriso/findjob.c

This commit is contained in:
Thomas Schmitt 2011-05-03 10:07:19 +00:00
parent 863bc34ac8
commit 9109d9c5ba
2 changed files with 15 additions and 9 deletions

View File

@ -760,17 +760,20 @@ improper_range:;
*/ */
int Findjob_set_name_expr(struct FindjoB *o, char *name_expr, int flag) int Findjob_set_name_expr(struct FindjoB *o, char *name_expr, int flag)
{ {
char regexpr[2*SfileadrL+2]; char *regexpr= NULL;
regex_t *name_re; regex_t *name_re;
struct ExprtesT *t; struct ExprtesT *t;
int ret; int ret;
regexpr= TSOB_FELD(char, 2*SfileadrL+2);
if(regexpr == NULL)
{ret= -1; goto ex;}
if(strlen(name_expr)>=SfileadrL) if(strlen(name_expr)>=SfileadrL)
return(0); {ret= 0; goto ex;};
ret= Findjob_default_and(o, 0); ret= Findjob_default_and(o, 0);
if(ret <= 0) if(ret <= 0)
return(ret); goto ex;
t= o->cursor->test; t= o->cursor->test;
t->test_type= 1; t->test_type= 1;
if ((flag & 3) == 1) if ((flag & 3) == 1)
@ -779,17 +782,20 @@ int Findjob_set_name_expr(struct FindjoB *o, char *name_expr, int flag)
t->test_type= 16; t->test_type= 16;
name_re= (regex_t *) calloc(1, sizeof(regex_t)); name_re= (regex_t *) calloc(1, sizeof(regex_t));
if(name_re == NULL) if(name_re == NULL)
return(-1); {ret= -1; goto ex;};
t->arg1= strdup(name_expr); t->arg1= strdup(name_expr);
if(t->arg1 == NULL) { if(t->arg1 == NULL) {
free((char *) name_re); free((char *) name_re);
return(-1); {ret= -1; goto ex;};
} }
Xorriso__bourne_to_reg(name_expr, regexpr, 0); Xorriso__bourne_to_reg(name_expr, regexpr, 0);
if(regcomp(name_re, regexpr, 0) != 0) if(regcomp(name_re, regexpr, 0) != 0)
return(0); {ret= 0; goto ex;};
t->arg2= name_re; t->arg2= name_re;
return(1); ret= 1;
ex:;
Xorriso_free_meM(regexpr);
return(ret);
} }

View File

@ -1 +1 @@
#define Xorriso_timestamP "2011.05.03.095849" #define Xorriso_timestamP "2011.05.03.100744"