*** ifhp.c.ORIG	Tue Jul 23 04:19:05 2002
--- ifhp.c	Mon Aug 19 15:38:42 2002
***************
*** 3232,3238 ****
  void Do_waitend( int waitend_timeout, int waitend_interval,
  	int waitend_ctrl_t_interval, int banner )
  {
! 	char *sync_str, *s, *t, *u, buffer[SMALLBUFFER], endname[SMALLBUFFER];
  	int len, elapsed, timeout, waitend,
  		use, use_pjl, use_ps, use_job, c,
  		echo_received = 0;
--- 3232,3238 ----
  void Do_waitend( int waitend_timeout, int waitend_interval,
  	int waitend_ctrl_t_interval, int banner )
  {
! 	char *sync_str, *s, *t, *u, buffer[SMALLBUFFER], endname[SMALLBUFFER], statusname[SMALLBUFFER];
  	int len, elapsed, timeout, waitend,
  		use, use_pjl, use_ps, use_job, c,
  		echo_received = 0;
***************
*** 3415,3421 ****
  			t = GET_HASH_STR_OBJ( Devstatus, "name", MEMINFO);
  			u = GET_HASH_STR_OBJ( Devstatus, "result", MEMINFO);
  			DEBUG2("Do_waitend: job '%s', name '%s', result '%s', endname '%s'", s, t, u, endname );
! 			if( s && safestrstr(s,"END") && t && safestrstr(t,endname) ){
  				waitend = 1;
  			}
  			/* we have the job cancelled, so we retry */ 
--- 3415,3427 ----
  			t = GET_HASH_STR_OBJ( Devstatus, "name", MEMINFO);
  			u = GET_HASH_STR_OBJ( Devstatus, "result", MEMINFO);
  			DEBUG2("Do_waitend: job '%s', name '%s', result '%s', endname '%s'", s, t, u, endname );
! 			/* if( s && safestrstr(s,"END") && t && safestrstr(t,endname) ){
! 				waitend = 1;
! 			} */
! 			if (t) { strcpy(statusname,t+1);
! 				statusname[strlen(statusname)-1]='\0';
! 			}
! 			if( s && strstr(s,"END") && t && strstr(Jobname,statusname) ){
  				waitend = 1;
  			}
  			/* we have the job cancelled, so we retry */ 
