diff -r 000000000000 -r 83f4b4db085c misccomponents/emulatorlauncher/src/RunPerl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/misccomponents/emulatorlauncher/src/RunPerl.cpp Tue Feb 02 01:39:43 2010 +0200 @@ -0,0 +1,80 @@ +// Copyright (c) 1999-2009 Nokia Corporation and/or its subsidiary(-ies). +// All rights reserved. +// This component and the accompanying materials are made available +// under the terms of "Eclipse Public License v1.0" +// which accompanies this distribution, and is available +// at the URL "http://www.eclipse.org/legal/epl-v10.html". +// +// Initial Contributors: +// Nokia Corporation - initial contribution. +// +// Contributors: +// +// Description: +// RunPerl.cpp : Defines the entry point for the console application. +// +// + + +#include +#include + +void main(int argc, char* argv[]) + { + + char** args = new char*[argc+3]; + int index = 0; + + char* p = argv[0]; + int pl = strlen(p); + if((pl >= 4) && + (*(p+pl-4)=='.') && + (*(p+pl-3)=='e' || *(p+pl-3)=='E') && + (*(p+pl-2)=='x' || *(p+pl-2)=='X') && + (*(p+pl-1)=='e' || *(p+pl-1)=='E')) + *(p+pl-4)='\0'; + char* cmd = new char[strlen(p)+4]; + strcpy(cmd,p); + strcat(cmd,".pl"); + + args[index++] = "perl"; + args[index++] = "-S"; + args[index++] = cmd; + + for(int i=1; i