--- procps-2.0.7/ps/sortformat.c.jj	Mon Jul 10 17:25:30 2000
+++ procps-2.0.7/ps/sortformat.c	Fri Apr  6 16:04:31 2001
@@ -33,7 +33,7 @@ static int already_parsed_format = 0;
 
 
 /****************  Parse single format specifier *******************/
-static format_node *do_one_spec(const char *spec, const char *override){
+static format_node *do_one_spec(const char *spec, const char *override, int force){
   const format_struct *fs;
   const macro_struct *ms;
 
@@ -74,7 +74,7 @@ static format_node *do_one_spec(const ch
       dist = strcspn(walk, ", ");
       strncpy(buf,walk,dist);
       buf[dist] = '\0';
-      newnode = do_one_spec(buf,override); /* call self, assume success */
+      newnode = do_one_spec(buf,override,1); /* call self, assume success */
       newnode->next = list;
       list = newnode;
       walk += dist;
@@ -83,8 +83,12 @@ static format_node *do_one_spec(const ch
     return list;
   }
 
-  fprintf(stderr,"spec value %s not found\n", spec);
-  _exit(1);
+  if (force){
+    fprintf(stderr,"spec value %s not found\n", spec);
+    _exit(1);
+  }
+
+  return NULL;
 }
 
 
@@ -96,13 +100,11 @@ static void O_wrap(sf_node *sfn, int oty
 
   trailer = (otype=='b') ? "END_BSD" : "END_SYS5" ;
 
-  fnode =  do_one_spec("pid",NULL);
-  if(!fnode)fprintf(stderr,"Seriously crashing. Goodbye cruel world.\n");
+  fnode =  do_one_spec("pid",NULL,1);
   endp = sfn->f_cooked; while(endp->next) endp = endp->next;  /* find end */
   endp->next = fnode;
   
-  fnode =  do_one_spec(trailer,NULL);
-  if(!fnode)fprintf(stderr,"Seriously crashing. Goodbye cruel world.\n");
+  fnode =  do_one_spec(trailer,NULL,1);
   endp = fnode; while(endp->next) endp = endp->next;  /* find end */
   endp->next = sfn->f_cooked;
   sfn->f_cooked = fnode;
@@ -178,7 +180,7 @@ out:
       *equal_loc = '\0';
       equal_loc++;
     }
-    fnode =  do_one_spec(walk,equal_loc);
+    fnode =  do_one_spec(walk,equal_loc,0);
     if(!fnode){
       free(buf);
       return "Unknown user-defined format specifier.";
@@ -250,7 +252,7 @@ trace("aix_format_parse called\n");
         free(buf);
         return "Unknown AIX field descriptor.";
       }
-      fnode =  do_one_spec(aix->spec, aix->head);
+      fnode =  do_one_spec(aix->spec, aix->head, 1);
       if(!fnode){
         free(buf);
         return "AIX field descriptor processing bug.";
@@ -634,7 +636,7 @@ static int fmt_delete(const char *findme
 
 
 /************ Build a SysV format backwards. ***********/
-#define PUSH(foo) (fn=do_one_spec(foo, NULL), fn->next=format_list, format_list=fn)
+#define PUSH(foo) (fn=do_one_spec(foo, NULL, 1), fn->next=format_list, format_list=fn)
 static const char *generate_sysv_list(void){
   format_node *fn;
   if((format_modifiers & FM_y) && !(format_flags & FF_Ul))
@@ -803,7 +805,7 @@ const char *process_sf_options(int local
     }
 
     if(spec){
-      fn = do_one_spec(spec, NULL); /* use override "" for no headers */
+      fn = do_one_spec(spec, NULL, 1); /* use override "" for no headers */
       fmt_walk = fn;
       while(fmt_walk){   /* put any nodes onto format_list in opposite way */
         format_node *travler;
@@ -822,26 +824,26 @@ const char *process_sf_options(int local
     format_node *fn;
     if(option_source) return "Can't use output modifiers with user-defined output";
     if(format_modifiers & FM_j){
-      fn = do_one_spec("pgid", NULL);
+      fn = do_one_spec("pgid", NULL, 1);
       if(!fmt_add_after("PPID", fn)) if(!fmt_add_after("PID", fn))
         return "Internal error, no PID or PPID for -j option.";
-      fn = do_one_spec("sid", NULL);
+      fn = do_one_spec("sid", NULL, 1);
       if(!fmt_add_after("PGID", fn)) return "Lost my PGID!";
     }
     if(format_modifiers & FM_y){
       /* TODO: check for failure to do something, and complain if so */
       fmt_delete("F");
-      fn = do_one_spec("rss", NULL);
+      fn = do_one_spec("rss", NULL, 1);
       if(fmt_add_after("ADDR", fn)) fmt_delete("ADDR");
     }
     if(format_modifiers & FM_c){
       fmt_delete("%CPU"); fmt_delete("CPU"); fmt_delete("CP"); fmt_delete("C");
       fmt_delete("NI");
-      fn = do_one_spec("class", NULL);
+      fn = do_one_spec("class", NULL, 1);
       if(!fmt_add_after("PRI", fn))
         return "Internal error, no PRI for -c option.";
       fmt_delete("PRI"); /* we want a different one */
-      fn = do_one_spec("pri", NULL);
+      fn = do_one_spec("pri", NULL, 1);
       if(!fmt_add_after("CLS", fn)) return "Lost my CLS!";
     }
   }
@@ -852,11 +854,11 @@ const char *process_sf_options(int local
      * That (mostly?) means the Digital and Debian personalities.
      */
     if((personality & PER_ZAP_ADDR) && (format_flags & FF_Ul)){
-      fn = do_one_spec("sgi_p", NULL);
+      fn = do_one_spec("sgi_p", NULL, 1);
       if(fmt_add_after("ADDR", fn)) fmt_delete("ADDR");
     }
     if((personality & PER_SANE_USER) && (format_flags & FF_Uf)){
-      fn = do_one_spec("user", NULL);
+      fn = do_one_spec("user", NULL, 1);
       if(fmt_add_after("UID", fn)) fmt_delete("UID");
     }
   }
