Dear list members,

attached is a patch against ifhp-3.5.11
which separates generation of jobnames
from generation of display names. I see no reason why
displaynames shouldn't contain for example ':'
(Handy for displaying times...)

Furthermore Pjl_display_size is enforced already
during generation of "Job_ready_msg" and "End_ready_msg",
so it is in one place. In the current code one
usage misses the shortening, but with the patch
applied that doesn't matter any more.

If the patch is accepted, of course in all other
places the shortening could thrown away.

Any comments are welcome,

greetings
   Hermann

-- 
Netzwerkadministration/Zentrale Dienste, Interdiziplinaeres 
Zentrum fuer wissenschaftliches Rechnen der Universitaet Heidelberg
IWR; INF 368; 69120 Heidelberg; Tel: (06221)54-8236 Fax: -5224
Email: [EMAIL PROTECTED]
--- ifhp-3.5.11/src/ifhp.c.orig Tue Nov 25 19:10:56 2003
+++ ifhp-3.5.11/src/ifhp.c      Tue Nov 25 22:09:44 2003
@@ -54,6 +54,7 @@
  char *PJL_str =  "@PJL\n";
  char *PJL_INFO_PAGECOUNT_str = "@PJL INFO PAGECOUNT \n";
  char Jobname[SMALLBUFFER];
+ char Job_ready_msg[SMALLBUFFER];
  char End_ready_msg[SMALLBUFFER];
  static void Pjl_displayname(void);
 
@@ -2785,14 +2786,9 @@
 }
 
 
-/* by hlauer: Hermann Lauer
- * Bildverarbeitungsgruppe des Interdiziplinaeren Zentrums fuer
- * wissenschaftliches Rechnen, Universitaet Heidelberg
- * INF 368; 69120 Heidelberg; Tel: (06221)54-8826, -6314  Fax: -8850
- * Email: [EMAIL PROTECTED]
+/* 
  * Use a common subroutine to build DISPLAY part - the job start
  *  could use this too.
- *  if console@, returns an empty string
  */
 
  char *Jobstart_str="@PJL JOB NAME = \"%s\"";
@@ -2820,6 +2816,10 @@
                s = msg;
        }
        SNPRINTF(Jobname,sizeof(Jobname))  "%s", s);
+        SNPRINTF(Job_ready_msg,sizeof(Jobname))  "%s", s); /* don't fix the DISPLAY 
name !*/ 
+       if( Pjl_display_size > 0 &&  safestrlen(Job_ready_msg) > Pjl_display_size ){
+               Job_ready_msg[Pjl_display_size] = 0;
+       }
        DEBUG2("Pjl_displayname: raw Jobname '%s'", Jobname);
        {
                int len = strlen(Jobname), i;
@@ -2839,6 +2839,9 @@
                }
        }
        SNPRINTF(End_ready_msg,sizeof(End_ready_msg))  "%s", msg);
+       if( Pjl_display_size > 0 &&  safestrlen(End_ready_msg) > Pjl_display_size ){
+               End_ready_msg[Pjl_display_size] = 0;
+       }
        DEBUG2("Pjl_displayname: End_ready_msg '%s'", End_ready_msg);
 }
 
@@ -2869,7 +2872,7 @@
        SNPRINTF(buffer+len, sizeof(buffer)-len) Jobstart_str, Jobname );
        len = safestrlen(buffer);
        if( Pjl_console ){
-               SNPRINTF(buffer+len, sizeof(buffer)-len) Job_display, Jobname );
+               SNPRINTF(buffer+len, sizeof(buffer)-len) Job_display, Job_ready_msg );
        }
 
        if( (s = GET_HASH_STR_OBJ( Zopts, "startpage", MEMINFO))
@@ -2930,7 +2933,7 @@
 {
        char buffer[SMALLBUFFER], name[SMALLBUFFER];
 
-       DEBUG2("Pjl_console: flag %d, start %d, jobname '%s ",
+        DEBUG2("Pjl_console: flag %d, start %d, jobname '%s ", /*that's wrong as 
Pjl_displayname() set's this*/
                Pjl_console, start, Jobname );
        if( Pjl == 0 || Pjl_console == 0 ){
                return;
@@ -2938,7 +2941,7 @@
        name[0] = 0;
        Pjl_displayname();
        if( start ){
-               SNPRINTF(name, sizeof(name))  "%s", Jobname );
+               SNPRINTF(name, sizeof(name))  "%s", Job_ready_msg );
        } else {
                SNPRINTF(name, sizeof(name))  "%s", End_ready_msg );
        }
@@ -3137,7 +3140,7 @@
                        PJL_ECHO_str, name );
                Put_pjl( buffer );
 
-               SNPRINTF(buffer, sizeof(buffer)) PJL_RDYMSG_str, Jobname ); Put_pjl( 
buffer );
+               SNPRINTF(buffer, sizeof(buffer)) PJL_RDYMSG_str, Job_ready_msg ); 
Put_pjl( buffer );
 
                if( pagecount_pjl ){
                        Put_pjl( PJL_INFO_PAGECOUNT_str );
@@ -3344,7 +3347,7 @@
                        SNPRINTF(buffer+len, sizeof(buffer)-len)  Jobstart_str, 
endname );
                        if( Pjl_console ){
                                char name[64];
-                               SNPRINTF(name, sizeof(name))  "%s",Jobname );
+                               SNPRINTF(name, sizeof(name))  "%s",Job_ready_msg );
                                if( Pjl_display_size > 0 &&  safestrlen(name) > 
Pjl_display_size ){
                                        name[Pjl_display_size] = 0;
                                }

Reply via email to