# HG changeset patch
# User etisserant
# Date 1219680061 -7200
# Node ID 43d65f0179e24bdd8dfa8e23377287d1f83cb58d
# Parent  71fddab24be9ffaf1476720ea7bd45f80d81a483
Fixed problem with first PLC argument (argv)

diff -r 71fddab24be9 -r 43d65f0179e2 runtime/PLCObject.py
--- a/runtime/PLCObject.py	Fri Aug 22 15:35:11 2008 +0200
+++ b/runtime/PLCObject.py	Mon Aug 25 18:01:01 2008 +0200
@@ -42,7 +42,7 @@
 class PLCObject(pyro.ObjBase):
     def __init__(self, workingdir, daemon, argv):
         pyro.ObjBase.__init__(self)
-        self.argv=argv
+        self.argv = [workingdir] + argv # force argv[0] to be "path" to exec...
         self.workingdir = workingdir
         self.PLCStatus = "Stopped"
         self.PLClibraryHandle = None
@@ -151,7 +151,7 @@
     def StartPLC(self):
         print "StartPLC"
         if self.CurrentPLCFilename is not None and self.PLCStatus == "Stopped":
-            c_argv = ctypes.c_char_p * len(sys.argv)
+            c_argv = ctypes.c_char_p * len(self.argv)
             if self._LoadNewPLC() and self._startPLC(len(self.argv),c_argv(*self.argv)) == 0:
                 self.PLCStatus = "Started"
                 return True