Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
fc89249e
Kaydet (Commit)
fc89249e
authored
Agu 29, 2013
tarafından
Jürgen Schmidt
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
#122864# merge fix from AOO401 branch
üst
95212768
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
34 deletions
+20
-34
python.cxx
pyuno/zipcore/python.cxx
+20
-34
No files found.
pyuno/zipcore/python.cxx
Dosyayı görüntüle @
fc89249e
...
@@ -93,51 +93,46 @@ int wmain(int argc, wchar_t ** argv, wchar_t **) {
...
@@ -93,51 +93,46 @@ int wmain(int argc, wchar_t ** argv, wchar_t **) {
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
}
}
}
}
wchar_t
bootstrap
[
MY_LENGTH
(
L"vnd.sun.star.pathname:"
)
+
MAX_PATH
]
=
wchar_t
bootstrap
[
MY_LENGTH
(
L"vnd.sun.star.pathname:"
)
+
MAX_PATH
]
=
L"vnd.sun.star.pathname:"
;
//TODO: overflow
L"vnd.sun.star.pathname:"
;
//TODO: overflow
wchar_t
*
bootstrapEnd
=
tools
::
buildPath
(
wchar_t
*
bootstrapEnd
=
tools
::
buildPath
(
bootstrap
+
MY_LENGTH
(
L"vnd.sun.star.pathname:"
),
path
,
pathEnd
,
bootstrap
+
MY_LENGTH
(
L"vnd.sun.star.pathname:"
),
path
,
pathEnd
,
MY_STRING
(
L"fundamental.ini"
));
MY_STRING
(
L"fundamental.ini"
));
if
(
bootstrapEnd
==
NULL
||
if
(
bootstrapEnd
==
NULL
)
(
tools
::
buildPath
(
path
,
path
,
pathEnd
,
MY_STRING
(
L"..
\\
basis-link"
))
==
NULL
))
{
{
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
}
}
pathEnd
=
tools
::
resolveLink
(
path
);
wchar_t
path1
[
MAX_PATH
];
wchar_t
*
path1End
=
tools
::
buildPath
(
path1
,
path
,
pathEnd
,
MY_STRING
(
L"
\\
program"
));
if
(
path1End
==
NULL
)
{
exit
(
EXIT_FAILURE
);
}
wchar_t
pythonpath2
[
MAX_PATH
];
wchar_t
pythonpath2
[
MAX_PATH
];
wchar_t
*
pythonpath2End
=
tools
::
buildPath
(
wchar_t
*
pythonpath2End
=
tools
::
buildPath
(
pythonpath2
,
path
,
pathEnd
,
pythonpath2
,
path
,
pathEnd
,
MY_STRING
(
L"
\\
program
\\
python-core-"
MY_PYVERSION
L"
\\
lib"
));
MY_STRING
(
L"python-core-"
MY_PYVERSION
L"
\\
lib"
));
if
(
pythonpath2End
==
NULL
)
{
if
(
pythonpath2End
==
NULL
)
{
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
}
}
wchar_t
pythonpath3
[
MAX_PATH
];
wchar_t
pythonpath3
[
MAX_PATH
];
wchar_t
*
pythonpath3End
=
tools
::
buildPath
(
wchar_t
*
pythonpath3End
=
tools
::
buildPath
(
pythonpath3
,
path
,
pathEnd
,
pythonpath3
,
path
,
pathEnd
,
MY_STRING
(
MY_STRING
(
L"
\\
program
\\
python-core-"
MY_PYVERSION
L"
\\
lib
\\
site-packages"
));
L"python-core-"
MY_PYVERSION
L"
\\
lib
\\
site-packages"
));
if
(
pythonpath3End
==
NULL
)
{
if
(
pythonpath3End
==
NULL
)
{
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
}
}
#ifdef __MINGW32__
#ifdef __MINGW32__
wchar_t
pythonpath4
[
MAX_PATH
];
wchar_t
pythonpath4
[
MAX_PATH
];
wchar_t
*
pythonpath4End
=
tools
::
buildPath
(
wchar_t
*
pythonpath4End
=
tools
::
buildPath
(
pythonpath4
,
path
,
pathEnd
,
pythonpath4
,
path
,
pathEnd
,
MY_STRING
(
L"
\\
program
\\
python-core-"
MY_PYVERSION
L"
\\
lib
\\
lib-dynload"
));
MY_STRING
(
L"python-core-"
MY_PYVERSION
L"
\\
lib
\\
lib-dynload"
));
if
(
pythonpath4End
==
NULL
)
{
if
(
pythonpath4End
==
NULL
)
{
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
}
}
wchar_t
pythonpath5
[
MAX_PATH
];
wchar_t
pythonpath5
[
MAX_PATH
];
wchar_t
*
pythonpath5End
=
tools
::
buildPath
(
wchar_t
*
pythonpath5End
=
tools
::
buildPath
(
pythonpath5
,
path
,
pathEnd
,
pythonpath5
,
path
,
pathEnd
,
MY_STRING
(
L"
\\
program
\\
python-core-"
MY_PYVERSION
L"
\\
lib
\\
lib-dynload"
));
MY_STRING
(
L"python-core-"
MY_PYVERSION
L"
\\
lib
\\
lib-dynload"
));
if
(
pythonpath5End
==
NULL
)
{
if
(
pythonpath5End
==
NULL
)
{
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
}
}
...
@@ -145,7 +140,7 @@ int wmain(int argc, wchar_t ** argv, wchar_t **) {
...
@@ -145,7 +140,7 @@ int wmain(int argc, wchar_t ** argv, wchar_t **) {
wchar_t
pythonhome
[
MAX_PATH
];
wchar_t
pythonhome
[
MAX_PATH
];
wchar_t
*
pythonhomeEnd
=
tools
::
buildPath
(
wchar_t
*
pythonhomeEnd
=
tools
::
buildPath
(
pythonhome
,
path
,
pathEnd
,
pythonhome
,
path
,
pathEnd
,
MY_STRING
(
L"
\\
program
\\
python-core-"
MY_PYVERSION
));
MY_STRING
(
L"python-core-"
MY_PYVERSION
));
if
(
pythonhomeEnd
==
NULL
)
{
if
(
pythonhomeEnd
==
NULL
)
{
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
}
}
...
@@ -154,26 +149,15 @@ int wmain(int argc, wchar_t ** argv, wchar_t **) {
...
@@ -154,26 +149,15 @@ int wmain(int argc, wchar_t ** argv, wchar_t **) {
pythonexe
,
path
,
pathEnd
,
pythonexe
,
path
,
pathEnd
,
#ifdef __MINGW32__
#ifdef __MINGW32__
MY_STRING
(
MY_STRING
(
L"
\\
program
\\
python-core-"
MY_PYVERSION
L"
\\
bin
\\
python.bin"
));
L"python-core-"
MY_PYVERSION
L"
\\
bin
\\
python.bin"
));
#else
#else
MY_STRING
(
MY_STRING
(
L"
\\
program
\\
python-core-"
MY_PYVERSION
L"
\\
bin
\\
python.exe"
));
L"python-core-"
MY_PYVERSION
L"
\\
bin
\\
python.exe"
));
#endif
#endif
if
(
pythonexeEnd
==
NULL
)
{
if
(
pythonexeEnd
==
NULL
)
{
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
}
}
if
(
tools
::
buildPath
(
path
,
path
,
pathEnd
,
MY_STRING
(
L"
\\
ure-link"
))
==
NULL
)
{
exit
(
EXIT_FAILURE
);
}
pathEnd
=
tools
::
resolveLink
(
path
);
if
(
pathEnd
==
NULL
)
{
exit
(
EXIT_FAILURE
);
}
pathEnd
=
tools
::
buildPath
(
path
,
path
,
pathEnd
,
MY_STRING
(
L"
\\
bin"
));
if
(
pathEnd
==
NULL
)
{
exit
(
EXIT_FAILURE
);
}
std
::
size_t
clSize
=
MY_LENGTH
(
L"
\"
"
)
+
4
*
(
pythonexeEnd
-
pythonexe
)
+
std
::
size_t
clSize
=
MY_LENGTH
(
L"
\"
"
)
+
4
*
(
pythonexeEnd
-
pythonexe
)
+
MY_LENGTH
(
L"
\"\0
"
);
//TODO: overflow
MY_LENGTH
(
L"
\"\0
"
);
//TODO: overflow
// 4 * len: each char preceded by backslash, each trailing backslash
// 4 * len: each char preceded by backslash, each trailing backslash
...
@@ -221,9 +205,11 @@ int wmain(int argc, wchar_t ** argv, wchar_t **) {
...
@@ -221,9 +205,11 @@ int wmain(int argc, wchar_t ** argv, wchar_t **) {
}
}
}
}
wchar_t
*
value
=
new
wchar_t
[
wchar_t
*
value
=
new
wchar_t
[
(
pathEnd
-
path
)
+
MY_LENGTH
(
L";"
)
+
(
path1End
-
path1
)
+
(
pathEnd
-
path
)
+
MY_LENGTH
(
L";"
)
+
(
n
==
0
?
0
:
MY_LENGTH
(
L";"
)
+
(
n
-
1
))
+
1
];
//TODO: overflow
(
n
==
0
?
0
:
MY_LENGTH
(
L";"
)
+
(
n
-
1
))
+
1
];
//TODO: overflow
wsprintfW
(
value
,
L"%s;%s%s%s"
,
path
,
path1
,
n
==
0
?
L""
:
L";"
,
orig
);
wsprintfW
(
value
,
L"%s%s%s"
,
path
,
n
==
0
?
L""
:
L";"
,
orig
);
if
(
!
SetEnvironmentVariableW
(
L"PATH"
,
value
))
{
if
(
!
SetEnvironmentVariableW
(
L"PATH"
,
value
))
{
exit
(
EXIT_FAILURE
);
exit
(
EXIT_FAILURE
);
}
}
...
@@ -258,11 +244,11 @@ int wmain(int argc, wchar_t ** argv, wchar_t **) {
...
@@ -258,11 +244,11 @@ int wmain(int argc, wchar_t ** argv, wchar_t **) {
n
==
0
?
L""
:
L";"
,
orig
);
n
==
0
?
L""
:
L";"
,
orig
);
#else
#else
value
=
new
wchar_t
[
value
=
new
wchar_t
[
(
p
ath1End
-
path1
)
+
MY_LENGTH
(
L";"
)
+
(
p
ythonpath2End
-
pythonpath2
)
+
(
pythonpath2End
-
pythonpath2
)
+
MY_LENGTH
(
L";"
)
+
(
pythonpath3End
-
pythonpath3
)
+
MY_LENGTH
(
L";"
)
+
(
pythonpath3End
-
pythonpath3
)
+
(
n
==
0
?
0
:
MY_LENGTH
(
L";"
)
+
(
n
-
1
))
+
1
];
//TODO: overflow
(
n
==
0
?
0
:
MY_LENGTH
(
L";"
)
+
(
n
-
1
))
+
1
];
//TODO: overflow
wsprintfW
(
wsprintfW
(
value
,
L"%s;%s
;%s%s%s"
,
path1
,
pythonpath2
,
pythonpath3
,
value
,
L"%s;%s
%s%s"
,
pythonpath2
,
pythonpath3
,
n
==
0
?
L""
:
L";"
,
orig
);
n
==
0
?
L""
:
L";"
,
orig
);
#endif
#endif
if
(
!
SetEnvironmentVariableW
(
L"PYTHONPATH"
,
value
))
{
if
(
!
SetEnvironmentVariableW
(
L"PYTHONPATH"
,
value
))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment