Changeset 2627


Ignore:
Timestamp:
2001-07-06T13:04:33+12:00 (23 years ago)
Author:
sjboddie
Message:

The recent bug fix to prevent collector problems when source directories
ended in a '\' didn't work on some systems (it seems that each different
version of windows has different rules where command line quoting is
converned!). It now simply removes any trailing '\' from each path rather
than attempting to escape all '\'s

Location:
trunk/gsdl/src/recpt
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/recpt/collectoraction.cpp

    r2621 r2627  
    15591559  options += " -title \"" + args["bc1fullname"] + "\"";
    15601560  options += " -about \"" + carriage_replace (args["bc1aboutdesc"] + "_collectorextra_", 0) + "\"";
    1561   options += " -collectdir \"" + tmpdir + "\" ";
    1562 
    1563   // escape any backslashes in options with a second backslash
    1564   escape_slashes(options);
     1561  options += " -collectdir \"" + remove_trailing_slashes(tmpdir) + "\" ";
    15651562
    15661563  text_t optionfile = filename_cat (tmpdir, "mkcol.opt");
     
    16711668      text_t type = "file://"; // default
    16721669      if (i < numtypes) type = inputtypes[i];
    1673       options += " -download \"" + type + format_url(decode_commas(inputvalues[i])) + "\"";
     1670      options += " -download \"" +
     1671    remove_trailing_slashes(type + format_url(decode_commas(inputvalues[i]))) + "\"";
    16741672    }
    16751673  }
     
    16881686    options += " -event_header " + ehead_file;
    16891687  }
    1690 
    1691   // escape any backslashes in options with a second backslash
    1692   escape_slashes(options);
    16931688
    16941689  text_t optionfile = filename_cat (tmpdir, "build.opt");
     
    19391934}
    19401935
    1941 void collectoraction::escape_slashes (text_t &oldval) {
    1942   text_t newval;
    1943   text_t::const_iterator here = oldval.begin();
    1944   text_t::const_iterator end = oldval.end();
    1945   while (here != end) {
    1946     if (*here == '\\') newval.push_back('\\');
    1947     newval.push_back(*here);
    1948     here ++;
    1949   }
    1950   oldval = newval;
    1951 }
     1936text_t collectoraction::remove_trailing_slashes (text_t str) {
     1937
     1938  while (*(str.end()-1) == '\\') {
     1939    str.pop_back();
     1940  }
     1941  return str;
     1942}
  • trunk/gsdl/src/recpt/collectoraction.h

    r2558 r2627  
    101101  text_t format_url (const text_t &url);
    102102
    103   void escape_slashes (text_t &oldval);
     103  text_t remove_trailing_slashes (text_t str);
    104104
    105105public:
Note: See TracChangeset for help on using the changeset viewer.