harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r533994 - in /harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/shared: libhlp.c main.c
Date Tue, 01 May 2007 10:34:06 GMT
Author: hindessm
Date: Tue May  1 03:34:03 2007
New Revision: 533994

URL: http://svn.apache.org/viewvc?view=rev&rev=533994
Log:
Remove local DIR_SEPERATOR (typo) and HY_PATH_SLASH definitions and use
DIR_SEPARATOR definitions from hycomp.h instead.

Modified:
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/shared/libhlp.c
    harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/shared/main.c

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/shared/libhlp.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/shared/libhlp.c?view=diff&rev=533994&r1=533993&r2=533994
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/shared/libhlp.c
(original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/shared/libhlp.c
Tue May  1 03:34:03 2007
@@ -22,8 +22,6 @@
 #include "hyport.h"
 #include "libhlp.h"
 
-#define HY_PATH_SLASH DIR_SEPARATOR
-
 I_32
 main_appendToClassPath (HyPortLibrary * portLib, U_16 sep,
                         HyStringBuffer ** classPath, char *toAppend)
@@ -106,20 +104,20 @@
   if ((strlen (javaHome) > 2) && (javaHome[1] == ':'))
     {
       javaHomeModifiablePart = javaHome + 2;
-      if (javaHome[2] == HY_PATH_SLASH)
+      if (javaHome[2] == DIR_SEPARATOR)
         javaHomeModifiablePart++;
     }
 #endif
 
 #if defined(WIN32)
   /* Make sure we don't modify the root of a UNC pathname. */
-  if ((strlen (javaHome) > 2) && (javaHome[0] == HY_PATH_SLASH)
-      && (javaHome[1] == HY_PATH_SLASH))
+  if ((strlen (javaHome) > 2) && (javaHome[0] == DIR_SEPARATOR)
+      && (javaHome[1] == DIR_SEPARATOR))
     {
       javaHomeModifiablePart = javaHome + 2;
       /* skip over the machine name */
       while (*javaHomeModifiablePart
-             && (*javaHomeModifiablePart != HY_PATH_SLASH))
+             && (*javaHomeModifiablePart != DIR_SEPARATOR))
         {
           javaHomeModifiablePart++;
         }
@@ -127,14 +125,14 @@
         javaHomeModifiablePart++;
       /* skip over the share name */
       while (*javaHomeModifiablePart
-             && (*javaHomeModifiablePart != HY_PATH_SLASH))
+             && (*javaHomeModifiablePart != DIR_SEPARATOR))
         {
           javaHomeModifiablePart++;
         }
     }
 #endif
 
-  if ((javaHomeModifiablePart == javaHome) && javaHome[0] == HY_PATH_SLASH)
+  if ((javaHomeModifiablePart == javaHome) && javaHome[0] == DIR_SEPARATOR)
     {
       /* make sure we don't modify a root slash. */
       javaHomeModifiablePart++;
@@ -142,7 +140,7 @@
 
   /* Note: if sysinfo_get_executable_name claims we were invoked from a root directory, */
   /* then this code will return that root directory for java.home also. */
-  p = strrchr (javaHomeModifiablePart, HY_PATH_SLASH);
+  p = strrchr (javaHomeModifiablePart, DIR_SEPARATOR);
   if (!p)
     {
       javaHomeModifiablePart[0] = '\0'; /* chop off whole thing! */
@@ -150,7 +148,7 @@
   else
     {
       p[0] = '\0';              /* chop off trailing slash and executable name. */
-      p = strrchr (javaHomeModifiablePart, HY_PATH_SLASH);
+      p = strrchr (javaHomeModifiablePart, DIR_SEPARATOR);
       if (!p)
         {
           javaHomeModifiablePart[0] = '\0';     /* chop off the rest */
@@ -197,7 +195,7 @@
     {
       goto done;
     }
-  p = strrchr (exeName, HY_PATH_SLASH);
+  p = strrchr (exeName, DIR_SEPARATOR);
   if (p)
     {
       p[1] = '\0';

Modified: harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/shared/main.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/shared/main.c?view=diff&rev=533994&r1=533993&r2=533994
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/shared/main.c (original)
+++ harmony/enhanced/classlib/trunk/modules/luni/src/main/native/launcher/shared/main.c Tue
May  1 03:34:03 2007
@@ -34,8 +34,6 @@
 
 #define HY_COPYRIGHT_STRING "Apache Harmony Launcher : (c) Copyright 1991, 2006 The Apache
Software Foundation or its licensors, as applicable."
 
-#define HY_PATH_SLASH DIR_SEPARATOR
-
 /* Tools launchers will invoke HY_TOOLS_PACKAGE+"."+<execname>+"."+HY_TOOLS_MAIN_TYPE
*/
 #define HY_TOOLS_PACKAGE "org.apache.harmony.tools"
 #define HY_TOOLS_MAIN_TYPE "Main"
@@ -95,14 +93,6 @@
             HyStringBuffer ** javaLibraryPathInd,
             char *vmdllsubdir, int *vmOptionsCount));
 
-#if defined(WIN32)
-#define	DIR_SEPERATOR '\\'
-#define	DIR_SEPERATOR_STRING "\\"
-#else
-#define	DIR_SEPERATOR '/'
-#define	DIR_SEPERATOR_STRING "/"
-#endif
-
 void
 printUsageMessage(HyPortLibrary * portLibrary)
 {
@@ -161,7 +151,7 @@
   hysysinfo_get_executable_name (argv[0], &exeName);
 
   /* Pick out the end of the exe path, and start of the basename */
-  exeBaseName = strrchr(exeName, HY_PATH_SLASH);
+  exeBaseName = strrchr(exeName, DIR_SEPARATOR);
   if (exeBaseName == NULL) {
 	  endPathPtr = exeBaseName = exeName;
   } else {
@@ -321,7 +311,7 @@
     vmiPath =
     hymem_allocate_memory (strlen (exeName) + strlen (vmdllsubdir) +
                             strlen (vmdll) +
-                            strlen (DIR_SEPERATOR_STRING) + 1);
+                            strlen (DIR_SEPARATOR_STR) + 1);
     if (vmiPath == NULL)
     {
         /* HYNLS_EXELIB_INTERNAL_VM_ERR_OUT_OF_MEMORY=Internal VM error: Out of memory\n
*/
@@ -335,7 +325,7 @@
     strcpy (newPathToAdd, exeName);
     strcat (newPathToAdd, vmdllsubdir);
     strcpy (vmiPath, newPathToAdd);
-    strcat (vmiPath, DIR_SEPERATOR_STRING);
+    strcat (vmiPath, DIR_SEPARATOR_STR);
     strcat (vmiPath, vmdll);
 
 #ifndef HY_NO_THR
@@ -814,7 +804,7 @@
   PORT_ACCESS_FROM_PORT (portLibrary);
   /* get the path to the executable */
   hysysinfo_get_executable_name (argv[0], &exeName);
-  endPathPtr = strrchr (exeName, DIR_SEPERATOR);
+  endPathPtr = strrchr (exeName, DIR_SEPARATOR);
   endPathPtr[0] = '\0';
 
   subst_values[0] = exeName;
@@ -1529,7 +1519,7 @@
   main_get_executable_name (argv[0], &exeName);
 
   /* Pick out the end of the exe path, and start of the basename */
-  exeBaseName = strrchr(exeName, HY_PATH_SLASH);
+  exeBaseName = strrchr(exeName, DIR_SEPARATOR);
   if (exeBaseName == NULL) {
     endPathPtr = exeBaseName = exeName;
   } else {



Mime
View raw message