~n-muench/ubuntu/oneiric/open-vm-tools/open-vm-tools.fix-836277

« back to all changes in this revision

Viewing changes to toolbox/toolboxInt.c

  • Committer: Bazaar Package Importer
  • Author(s): Daniel Baumann
  • Date: 2009-07-30 12:56:49 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20090730125649-97sfj5li8axiseoo
Tags: 2009.07.22-179896-2
* Temporarily building without dumbnet, the recently uploaded
  new dumbnet upstream version broke down (Closes: #539006).
* Using more common name to store local debian additions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
/*
37
37
 *-----------------------------------------------------------------------------
38
38
 *
 
39
 * Toolbox_GetScriptPath --
 
40
 *
 
41
 *    Returns the absolute path to the given script. Relative paths
 
42
 *    given as input to this function are considered to be relative
 
43
 *    to the Tools "install" path.
 
44
 *
 
45
 * Results:
 
46
 *    The absolute path of the script.
 
47
 *
 
48
 * Side effects:
 
49
 *    None.
 
50
 *
 
51
 *-----------------------------------------------------------------------------
 
52
 */
 
53
 
 
54
#if defined(_WIN32)
 
55
gchar *
 
56
Toolbox_GetScriptPath(const wchar_t *scriptUtf16)  // IN
 
57
#else
 
58
gchar *
 
59
Toolbox_GetScriptPath(const gchar *script)   // IN
 
60
#endif
 
61
{
 
62
   gchar *ret;
 
63
#if defined(_WIN32)
 
64
   gchar *script;
 
65
   GError *err = NULL;
 
66
 
 
67
   script = g_utf16_to_utf8(scriptUtf16, -1, NULL, NULL, &err);
 
68
   if (err != NULL) {
 
69
      g_error("Error converting to UTF8: %s\n", err->message);
 
70
   }
 
71
#endif
 
72
   if (!g_path_is_absolute(script)) {
 
73
      char *toolsPath = GuestApp_GetInstallPath();
 
74
      ASSERT_MEM_ALLOC(toolsPath);
 
75
      ret = g_strdup_printf("%s%c%s", toolsPath, DIRSEPC, script);
 
76
      free(toolsPath);
 
77
   } else {
 
78
      ret = g_strdup(script);
 
79
   }
 
80
#if defined(_WIN32)
 
81
   g_free(script);
 
82
#endif
 
83
   return ret;
 
84
}
 
85
 
 
86
 
 
87
/*
 
88
 *-----------------------------------------------------------------------------
 
89
 *
39
90
 * Toolbox_LoadToolsConf --
40
91
 *
41
92
 *    Load the Tools configuration file from the default location.