Branch: Tag:

1997-09-04

1997-09-04 12:40:02 by Henrik Grubbström (Grubba) <grubba@grubba.org>

Fixed empty-word bug.

Rev: server/modules/graphics/graphic_text.pike:1.66

1: - constant cvs_version="$Id: graphic_text.pike,v 1.65 1997/09/03 18:49:27 grubba Exp $"; + constant cvs_version="$Id: graphic_text.pike,v 1.66 1997/09/04 12:40:02 grubba Exp $";   constant thread_safe=1;      #include <module.h>
633:    }    if(!args->verbatim)    { -  string res="",nspace="",cspace="", nonum; +  string res="",nspace="",cspace="";    foreach(text/"\n", string line)    {    cspace="";nspace="";    foreach(line/" ", string word)    { -  +  string nonum;    if(strlen(word) && -  (nonum=replace(word,({"1","2","3","4","5","6","7","8","9","0","."}), -  ({"","","","","","","","","","",""}))) -  =="") +  (nonum = replace(word, +  ({"1","2","3","4","5","6","7","8","9","0","."}), +  ({"","","","","","","","","","",""}))) == "") {    cspace=nbsp+nbsp; -  else if(cspace!="") -  cspace=" "; -  if((strlen(word)-strlen(nonum)<strlen(word)/2) && (upper_case(word) == word)) +  if((strlen(word)-strlen(nonum)<strlen(word)/2) && +  (upper_case(word) == word)) {    word=((word/"")*nbsp); -  +  } +  } else if(cspace!="") { +  cspace=" "; +  }    res+=(nspace==cspace?nspace:" ")+word;       if(cspace!="") nspace=cspace;