all repos — fluxbox @ 66ea6cf7828d437a66e9795c6b02fb238ad467dd

custom fork of the fluxbox windowmanager

Moved to std::string from std::strstream
fluxgen fluxgen
commit

66ea6cf7828d437a66e9795c6b02fb238ad467dd

parent

49f3715f0cfcdce8fe67e71157ab1efffb920586

1 files changed, 19 insertions(+), 20 deletions(-)

jump to
M src/Theme.ccsrc/Theme.cc

@@ -41,7 +41,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Theme.cc,v 1.8 2002/01/08 00:12:51 fluxgen Exp $ +// $Id: Theme.cc,v 1.9 2002/01/08 11:37:15 fluxgen Exp $ #ifndef _GNU_SOURCE #define _GNU_SOURCE

@@ -66,7 +66,6 @@

#include <cstdio> #include <cstdarg> #include <string> -#include <strstream> #include <iostream> using namespace std;

@@ -656,16 +655,16 @@ XrmValue value;

char *value_type; if (m_rootcommand.size()) { - #ifndef __EMX__ - //const int display_strlen = 1024; - //char displaystring[display_strlen]; - strstream displaystring; - displaystring<<"DISPLAY="<<DisplayString(m_display)<<m_screennum; - cerr<<__FILE__<<"("<<__LINE__<<"): displaystring="<<displaystring.str()<<endl; - //snprintf(displaystring, display_strlen, "DISPLAY=%s%d", - //DisplayString(m_display), m_screennum); - - bexec(m_rootcommand.c_str(), displaystring.str()); + #ifndef __EMX__ + char tmpstring[256]; //to hold m_screennum + tmpstring[0]=0; + sprintf(tmpstring, "%d", m_screennum); + string displaystring("DISPLAY="); + displaystring.append(DisplayString(m_display)); + displaystring.append(tmpstring); // append m_screennum + cerr<<__FILE__<<"("<<__LINE__<<"): displaystring="<<displaystring.c_str()<<endl; + + bexec(m_rootcommand.c_str(), const_cast<char *>(displaystring.c_str())); #else // __EMX__ spawnlp(P_NOWAIT, "cmd.exe", "cmd.exe", "/c", m_rootcommand.c_str(), NULL); #endif // !__EMX__

@@ -677,15 +676,15 @@

} else if (XrmGetResource(m_database, "rootCommand", "RootCommand", &value_type, &value)) { #ifndef __EMX__ - //const int display_strlen = 1024; - //char displaystring[display_strlen]; - strstream displaystring; - displaystring<<"DISPLAY="<<DisplayString(m_display)<<m_screennum; - cerr<<__FILE__<<"("<<__LINE__<<"): displaystring="<<displaystring.str()<<endl; - //snprintf(displaystring, display_strlen, "DISPLAY=%s%d", - // DisplayString(m_display), m_screennum); + char tmpstring[256]; //to hold m_screennum + tmpstring[0]=0; + sprintf(tmpstring, "%d", m_screennum); + string displaystring("DISPLAY="); + displaystring.append(DisplayString(m_display)); + displaystring.append(tmpstring); // append m_screennum + cerr<<__FILE__<<"("<<__LINE__<<"): displaystring="<<displaystring.c_str()<<endl; - bexec(value.addr, displaystring.str()); + bexec(value.addr, const_cast<char *>(displaystring.c_str())); #else // __EMX__ spawnlp(P_NOWAIT, "cmd.exe", "cmd.exe", "/c", value.addr, NULL); #endif // !__EMX__