]> git.lyx.org Git - lyx.git/blobdiff - src/support/os_os2.C
* lyxfunctional.h: delete compare_memfun and helper classes
[lyx.git] / src / support / os_os2.C
index 5b2ec5864f5634c5a755b5bc018dab25c314c548..bf73d8e505354c85a52c918c283b9b099df39818 100644 (file)
@@ -1,6 +1,15 @@
-// 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_;
@@ -35,12 +48,12 @@ void init(int * argc, char ** argv[])
                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);