tThe gettext translation of "" returns the po-file header. gettext was being called for every drug's CheapStr, and some drugs have a blank - i.e. "" - CheapStr, so these drugs were getting garbage in their CheapStr field. Now fixed! - vaccinewars - be a doctor and try to vaccinate the world
 (HTM) git clone git://src.adamsgaard.dk/vaccinewars
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 8cec7a7f2f476158073ff0fccbce3319d2b252ae
 (DIR) parent 4ab8c5cd6833234946dd625d1fc3b9dd3a52aa99
 (HTM) Author: Ben Webb <ben@salilab.org>
       Date:   Mon, 29 Apr 2002 10:21:51 +0000
       
       The gettext translation of "" returns the po-file header. gettext was
       being called for every drug's CheapStr, and some drugs have a blank -
       i.e. "" - CheapStr, so these drugs were getting garbage in their CheapStr
       field. Now fixed!
       
       
       Diffstat:
         M src/dopewars.c                      |      20 ++++++++++++++++++--
       
       1 file changed, 18 insertions(+), 2 deletions(-)
       ---
 (DIR) diff --git a/src/dopewars.c b/src/dopewars.c
       t@@ -1660,12 +1660,12 @@ void CopyGun(struct GUN *dest, struct GUN *src)
        
        void CopyDrug(struct DRUG *dest, struct DRUG *src)
        {
       -  AssignName(&dest->Name, _(src->Name));
       +  AssignName(&dest->Name, src->Name[0] ? _(src->Name) : "");
          dest->MinPrice = src->MinPrice;
          dest->MaxPrice = src->MaxPrice;
          dest->Cheap = src->Cheap;
          dest->Expensive = src->Expensive;
       -  AssignName(&dest->CheapStr, _(src->CheapStr));
       +  AssignName(&dest->CheapStr, src->CheapStr[0] ? _(src->CheapStr) : "");
        }
        
        void CopyDrugs(struct DRUGS *dest, struct DRUGS *src)
       t@@ -2679,6 +2679,22 @@ void GeneralStartup(int argc, char *argv[])
          }
        }
        
       +/*
       + * Removes any ^ characters from the given string, which is modified in place.
       + */
       +void StripTerminators(gchar *str)
       +{
       +  int i;
       +
       +  if (str) {
       +    for (i = 0; i < strlen(str); i++) {
       +      if (str[i] == '^') {
       +        str[i] = '~';
       +      }
       +    }
       +  }
       +}
       +
        /* 
         * Returns the text to be displayed in a log message, if any.
         */