-// os_os2.C
+/**
+ * \file os_os2.C
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
+ * \author Ruurd A. Reitsma
+ *
+ * Full author contact details are available in file CREDITS.
+ *
+ * Various OS specific functions
+ */
-// Various OS specific functions
#include <config.h>
#include "os.h"
#define INCL_DOSERRORS
#include <os2.h>
+#include <boost/scoped_array.hpp>
+
+using boost::scoped_array;
+
namespace {
string binpath_;
APIRET rc = DosGetInfoBlocks(&ptib, &ppib);
if (rc != NO_ERROR)
exit(rc);
- char* tmp = new char[256];
+ scoped_array<char> tmp(new char[256]);
// This is the only reliable way to retrieve the executable name.
rc = DosQueryModuleName(ppib->pib_hmte, 256L, tmp);
if (rc != NO_ERROR)
exit(rc);
- string p = tmp;
+ string p = tmp.get();
p = slashify_path(p);
binname_ = OnlyFilename(p);
binname_.erase(binname_.length()-4, string::npos);