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
3adb006b
Kaydet (Commit)
3adb006b
authored
Ara 17, 2011
tarafından
Norbert Thiebaud
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
concat-deps.c deal with /../ in dep path
üst
d18daeff
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
9 deletions
+30
-9
concat-deps.c
solenv/bin/concat-deps.c
+30
-9
No files found.
solenv/bin/concat-deps.c
Dosyayı görüntüle @
3adb006b
...
@@ -684,9 +684,11 @@ int rc;
...
@@ -684,9 +684,11 @@ int rc;
char
*
buffer
;
char
*
buffer
;
char
*
end
;
char
*
end
;
char
*
cursor
;
char
*
cursor
;
char
*
cursor_out
;
char
*
base
;
char
*
base
;
int
continuation
=
0
;
int
continuation
=
0
;
char
last_ns
=
0
;
char
last_ns
=
0
;
char
*
last_slash
=
NULL
;
off_t
size
;
off_t
size
;
buffer
=
file_load
(
fn
,
&
size
,
&
rc
);
buffer
=
file_load
(
fn
,
&
size
,
&
rc
);
...
@@ -697,20 +699,38 @@ off_t size;
...
@@ -697,20 +699,38 @@ off_t size;
*/
*/
if
(
!
rc
)
if
(
!
rc
)
{
{
base
=
cursor
=
end
=
buffer
;
base
=
cursor
_out
=
cursor
=
end
=
buffer
;
end
+=
size
;
end
+=
size
;
while
(
cursor
<
end
)
while
(
cursor
<
end
)
{
{
if
(
*
cursor
==
'\\'
)
if
(
*
cursor
==
'\\'
)
{
{
continuation
=
1
;
continuation
=
1
;
cursor
+=
1
;
*
cursor_out
++
=
*
cursor
++
;
}
else
if
(
*
cursor
==
'/'
)
{
if
(
cursor
+
3
<
end
)
{
if
(
!
memcmp
(
cursor
,
"/../"
,
4
))
{
if
(
last_slash
!=
NULL
)
{
/* bactrack to the previous '/' */
cursor_out
=
last_slash
;
/* skip the /.. section */
cursor
+=
3
;
}
}
}
last_slash
=
cursor_out
;
*
cursor_out
++
=
*
cursor
++
;
}
}
else
if
(
*
cursor
==
'\n'
)
else
if
(
*
cursor
==
'\n'
)
{
{
if
(
!
continuation
)
if
(
!
continuation
)
{
{
*
cursor
=
0
;
*
cursor
_out
=
0
;
if
(
base
<
cursor
)
if
(
base
<
cursor
)
{
{
/* here we have a complete rule */
/* here we have a complete rule */
...
@@ -720,7 +740,7 @@ off_t size;
...
@@ -720,7 +740,7 @@ off_t size;
* these are the one for which we want to filter
* these are the one for which we want to filter
* duplicate out
* duplicate out
*/
*/
if
(
hash_store
(
dep_hash
,
base
,
(
int
)(
cursor
-
base
)))
if
(
hash_store
(
dep_hash
,
base
,
(
int
)(
cursor
_out
-
base
)))
{
{
puts
(
base
);
puts
(
base
);
putc
(
'\n'
,
stdout
);
putc
(
'\n'
,
stdout
);
...
@@ -734,14 +754,15 @@ off_t size;
...
@@ -734,14 +754,15 @@ off_t size;
}
}
}
}
cursor
+=
1
;
cursor
+=
1
;
base
=
cursor
;
base
=
cursor
_out
=
cursor
;
}
}
else
else
{
{
/* here we have a '\' followed by \n this is a continuation
/* here we have a '\' followed by \n this is a continuation
* i.e not a complete rule yet
* i.e not a complete rule yet
*/
*/
cursor
+=
1
;
last_slash
=
NULL
;
*
cursor_out
++
=
*
cursor
++
;
}
}
}
}
else
else
...
@@ -752,15 +773,15 @@ off_t size;
...
@@ -752,15 +773,15 @@ off_t size;
{
{
last_ns
=
*
cursor
;
last_ns
=
*
cursor
;
}
}
cursor
+=
1
;
*
cursor_out
++
=
*
cursor
++
;
}
}
}
}
/* just in case the file did not end with a \n, there may be a pending rule */
/* just in case the file did not end with a \n, there may be a pending rule */
if
(
base
<
cursor
)
if
(
base
<
cursor
_out
)
{
{
if
(
last_ns
==
':'
)
if
(
last_ns
==
':'
)
{
{
if
(
hash_store
(
dep_hash
,
base
,
(
int
)(
cursor
-
base
)))
if
(
hash_store
(
dep_hash
,
base
,
(
int
)(
cursor
_out
-
base
)))
{
{
puts
(
base
);
puts
(
base
);
putc
(
'\n'
,
stdout
);
putc
(
'\n'
,
stdout
);
...
...
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