diff dwt/internal/Library.d @ 45:d8635bb48c7c

Merge with SWT 3.5
author Jacob Carlborg <doob@me.com>
date Mon, 01 Dec 2008 17:07:00 +0100
parents 5b53d338c709
children cfa563df4fdd
line wrap: on
line diff
--- a/dwt/internal/Library.d	Tue Oct 21 15:20:04 2008 +0200
+++ b/dwt/internal/Library.d	Mon Dec 01 17:07:00 2008 +0100
@@ -1,5 +1,5 @@
-/*******************************************************************************
- * Copyright (c) 2000, 2007 IBM Corporation and others.
+/*******************************************************************************
+ * Copyright (c) 2000, 2008 IBM Corporation and others.
  * All rights reserved. This program and the accompanying materials
  * are made available under the terms of the Eclipse Public License v1.0
  * which accompanies this distribution, and is available at
@@ -38,7 +38,7 @@
     /**
      * DWT Minor version number (must be in the range 0..999)
      */
-    static const int MINOR_VERSION = 440;
+    static int MINOR_VERSION = 514;
 
     /**
      * DWT revision number (must be >= 0)
@@ -132,10 +132,12 @@
  FileOutputStream os = null;
  InputStream is = null;
  File file = new File(fileName);
+    bool extracted = false;
  try {
  if (!file.exists ()) {
  is = Library.class.getResourceAsStream ("/" + mappedName); //$NON-NLS-1$
  if (is !is null) {
+                extracted = true;
  int read;
  byte [] buffer = new byte [4096];
  os = new FileOutputStream (fileName);
@@ -152,6 +154,7 @@
  if (load (fileName)) return true;
  }
  }
+        if (load (fileName)) return true;
  } catch (Throwable e) {
  try {
  if (os !is null) os.close ();
@@ -159,8 +162,8 @@
  try {
  if (is !is null) is.close ();
  } catch (IOException e1) {}
+        if (extracted && file.exists ()) file.delete ();
  }
- if (file.exists ()) file.delete ();
  return false;
  }