X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;ds=sidebyside;f=synfig-studio%2Ftrunk%2Fsrc%2Fgtkmm%2Fipc.cpp;h=b7be6ec5fc7e6a735a982411c91b35c76ccc62ff;hb=197d6d1c81c6dec1b762af182cadcfc7404823e6;hp=7b5cfbd0ed48e0680d33df57ae9628411e293001;hpb=837b63e9fb829d66d43f4f169861f8979f76820d;p=synfig.git diff --git a/synfig-studio/trunk/src/gtkmm/ipc.cpp b/synfig-studio/trunk/src/gtkmm/ipc.cpp index 7b5cfbd..b7be6ec 100644 --- a/synfig-studio/trunk/src/gtkmm/ipc.cpp +++ b/synfig-studio/trunk/src/gtkmm/ipc.cpp @@ -6,6 +6,7 @@ ** ** \legal ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley +** Copyright (c) 2007 Chris Moore ** ** This package is free software; you can redistribute it and/or ** modify it under the terms of the GNU General Public License as @@ -66,6 +67,8 @@ #include #include +#include "general.h" + #endif /* === U S I N G =========================================================== */ @@ -224,8 +227,6 @@ IPC::fifo_path() bool IPC::fifo_activity(Glib::IOCondition cond) { - synfig::info(__FILE__":%d: fifo activity",__LINE__); - if(cond&(Glib::IO_ERR|Glib::IO_HUP|Glib::IO_NVAL)) { if(cond&(Glib::IO_ERR)) @@ -259,11 +260,17 @@ IPC::process_command(const synfig::String& command_line) if(command_line.empty()) return false; - char cmd=command_line[0]; + char cmd = command_line[0]; String args(command_line.begin()+1,command_line.end()); - while(!args.empty() && args[0]==' ') args.erase(args.begin()); - while(!args.empty() && args[args.size()-1]=='\n' || args[args.size()-1]==' ') args.erase(args.end()-1); + + // erase leading spaces + while (!args.empty() && args[0] == ' ') + args.erase(args.begin()); + + // erase trailing newlines and spaces + while (!args.empty() && (args[args.size()-1] == '\n' || args[args.size()-1] == ' ')) + args.erase(args.end()-1); switch(toupper(cmd)) { @@ -329,7 +336,7 @@ IPC::make_connection() ret=SmartFILE(fdopen(fd,"w")); #ifdef _DEBUG - synfig::info("uplink fd=%d",fd); + // synfig::info("uplink fd=%d",fd); #endif return ret;