licenses.list.txt 40 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190
  1. ====================COPYRIGHT====================
  2. Copyright (C) 1998, 2001, 2003-2006, 2009-2016 Free Software Foundation,
  3. Inc.
  4. ====================COPYRIGHT====================
  5. Copyright (C) 1985, 1989-1993, 1995-1998, 2000-2003, 2005-2016 Free Software
  6. Foundation, Inc.
  7. This file is part of the GNU C Library.
  8. ====================COPYRIGHT====================
  9. Copyright (C) 1987-1994, 1996-1998, 2004, 2006, 2009-2016 Free Software
  10. Foundation, Inc.
  11. This file is part of the GNU C Library.
  12. ====================COPYRIGHT====================
  13. Copyright (C) 1987-1996, 1998-2004, 2006, 2008-2016 Free Software
  14. Foundation, Inc.
  15. This file is part of the GNU C Library.
  16. ====================COPYRIGHT====================
  17. Copyright (C) 1989-1994, 1996-1999, 2001, 2003-2004, 2009-2016 Free Software
  18. Foundation, Inc.
  19. This file is part of the GNU C Library.
  20. ====================COPYRIGHT====================
  21. Copyright (C) 1989-1994, 1996-1999, 2001, 2003-2007, 2009-2013 Free Software
  22. Foundation, Inc.
  23. This file is part of the GNU C Library.
  24. ====================COPYRIGHT====================
  25. Copyright (C) 1990, 1998, 2000-2001, 2003-2006, 2009-2016 Free Software
  26. Foundation, Inc.
  27. ====================COPYRIGHT====================
  28. Copyright (C) 1990, 1998-2001, 2003-2006, 2009-2016 Free Software
  29. Foundation, Inc.
  30. ====================COPYRIGHT====================
  31. Copyright (C) 1990, 2001, 2003-2006, 2009-2016 Free Software Foundation,
  32. Inc.
  33. ====================COPYRIGHT====================
  34. Copyright (C) 1990-1998, 2000-2007, 2009-2016 Free Software Foundation, Inc.
  35. This file is part of the GNU C Library.
  36. ====================COPYRIGHT====================
  37. Copyright (C) 1990-2000, 2002-2006, 2008-2016 Free Software Foundation, Inc.
  38. ====================COPYRIGHT====================
  39. Copyright (C) 1990-2000, 2003-2004, 2006-2016 Free Software Foundation, Inc.
  40. ====================COPYRIGHT====================
  41. Copyright (C) 1991, 2004-2006, 2009-2016 Free Software Foundation, Inc.
  42. ====================COPYRIGHT====================
  43. Copyright (C) 1991-2003, 2005-2007, 2009-2016 Free Software Foundation, Inc.
  44. ====================COPYRIGHT====================
  45. Copyright (C) 1992, 1999, 2001, 2003, 2005, 2009-2016 Free Software
  46. Foundation, Inc.
  47. ====================COPYRIGHT====================
  48. Copyright (C) 1995, 1998, 2001, 2003, 2005, 2009-2016 Free Software
  49. Foundation, Inc.
  50. ====================COPYRIGHT====================
  51. Copyright (C) 1995, 1999, 2001-2004, 2006-2013 Free Software Foundation,
  52. Inc.
  53. ====================COPYRIGHT====================
  54. Copyright (C) 1995-1996, 2001, 2003, 2005, 2009-2016 Free Software
  55. Foundation, Inc.
  56. ====================COPYRIGHT====================
  57. Copyright (C) 1995-1997, 2003, 2006, 2008-2016 Free Software Foundation,
  58. Inc.
  59. This file is part of the GNU C Library.
  60. ====================COPYRIGHT====================
  61. Copyright (C) 1995-1998, 2000-2002, 2004-2006, 2009-2016 Free Software
  62. Foundation, Inc.
  63. ====================COPYRIGHT====================
  64. Copyright (C) 1996-1997, 2003, 2005, 2007, 2009-2016 Free Software
  65. Foundation, Inc.
  66. ====================COPYRIGHT====================
  67. Copyright (C) 1996-1999, 2008-2016 Free Software Foundation, Inc.
  68. This file is part of the GNU C Library.
  69. ====================COPYRIGHT====================
  70. Copyright (C) 1996-2007, 2009-2016 Free Software Foundation, Inc.
  71. ====================COPYRIGHT====================
  72. Copyright (C) 1997-1999, 2002-2004, 2006-2007, 2009-2016 Free Software
  73. Foundation, Inc.
  74. ====================COPYRIGHT====================
  75. Copyright (C) 1997-2000, 2002-2004, 2006, 2009-2016 Free Software
  76. Foundation, Inc.
  77. ====================COPYRIGHT====================
  78. Copyright (C) 1998, 2000, 2003-2004, 2006, 2008-2016 Free Software
  79. Foundation, Inc.
  80. ====================COPYRIGHT====================
  81. Copyright (C) 1998-1999, 2005-2006, 2009-2016 Free Software Foundation, Inc.
  82. ====================COPYRIGHT====================
  83. Copyright (C) 1998-2001, 2003, 2009-2016 Free Software Foundation, Inc.
  84. ====================COPYRIGHT====================
  85. Copyright (C) 1998-2002, 2004, 2006, 2008-2016 Free Software Foundation,
  86. Inc.
  87. ====================COPYRIGHT====================
  88. Copyright (C) 1998-2002, 2004, 2006-2016 Free Software Foundation, Inc.
  89. ====================COPYRIGHT====================
  90. Copyright (C) 1998-2002, 2004-2016 Free Software Foundation, Inc.
  91. ====================COPYRIGHT====================
  92. Copyright (C) 1999, 2002, 2006, 2009-2016 Free Software Foundation, Inc.
  93. ====================COPYRIGHT====================
  94. Copyright (C) 1999, 2002, 2006-2016 Free Software Foundation, Inc.
  95. ====================COPYRIGHT====================
  96. Copyright (C) 1999, 2002-2003, 2005, 2007, 2010-2016 Free Software
  97. Foundation, Inc.
  98. ====================COPYRIGHT====================
  99. Copyright (C) 1999, 2002-2003, 2005-2007, 2009-2016 Free Software
  100. Foundation, Inc.
  101. ====================COPYRIGHT====================
  102. Copyright (C) 1999, 2002-2003, 2006-2007, 2011-2016 Free Software
  103. Foundation, Inc.
  104. ====================COPYRIGHT====================
  105. Copyright (C) 1999, 2002-2004, 2006, 2009-2016 Free Software Foundation,
  106. Inc.
  107. ====================COPYRIGHT====================
  108. Copyright (C) 1999, 2002-2004, 2006-2016 Free Software Foundation, Inc.
  109. ====================COPYRIGHT====================
  110. Copyright (C) 1999, 2002-2016 Free Software Foundation, Inc.
  111. ====================COPYRIGHT====================
  112. Copyright (C) 1999, 2003, 2005, 2009-2016 Free Software Foundation, Inc.
  113. ====================COPYRIGHT====================
  114. Copyright (C) 1999, 2003-2004, 2009-2016 Free Software Foundation, Inc.
  115. ====================COPYRIGHT====================
  116. Copyright (C) 1999, 2004-2007, 2009-2016 Free Software Foundation, Inc.
  117. ====================COPYRIGHT====================
  118. Copyright (C) 1999-2000, 2002-2003, 2006-2016 Free Software Foundation, Inc.
  119. ====================COPYRIGHT====================
  120. Copyright (C) 1999-2002, 2005-2016 Free Software Foundation, Inc.
  121. Written by Bruno Haible <bruno@clisp.org>, 2008.
  122. ====================COPYRIGHT====================
  123. Copyright (C) 1999-2016 Free Software Foundation, Inc.
  124. ====================COPYRIGHT====================
  125. Copyright (C) 2000, 2003, 2005-2006, 2009-2016 Free Software Foundation,
  126. Inc.
  127. ====================COPYRIGHT====================
  128. Copyright (C) 2000, 2003-2004, 2008-2013 Free Software Foundation, Inc.
  129. This file is part of the GNU C Library.
  130. ====================COPYRIGHT====================
  131. Copyright (C) 2000, 2004, 2006-2007, 2009-2021 Free Software Foundation,
  132. Inc.
  133. ====================COPYRIGHT====================
  134. Copyright (C) 2000-2001, 2004-2006, 2009-2016 Free Software Foundation, Inc.
  135. ====================COPYRIGHT====================
  136. Copyright (C) 2000-2003, 2006, 2008-2016 Free Software Foundation, Inc.
  137. ====================COPYRIGHT====================
  138. Copyright (C) 2000-2003, 2009-2016 Free Software Foundation, Inc.
  139. This file is part of the GNU CHARSET Library.
  140. ====================COPYRIGHT====================
  141. Copyright (C) 2000-2006, 2008-2016 Free Software Foundation, Inc.
  142. ====================COPYRIGHT====================
  143. Copyright (C) 2001, 2003, 2005, 2008-2016 Free Software Foundation, Inc.
  144. ====================COPYRIGHT====================
  145. Copyright (C) 2001, 2003, 2005, 2009-2016 Free Software Foundation, Inc.
  146. ====================COPYRIGHT====================
  147. Copyright (C) 2001, 2003, 2006, 2009-2016 Free Software Foundation, Inc.
  148. ====================COPYRIGHT====================
  149. Copyright (C) 2001, 2003, 2006-2007, 2009-2016 Free Software Foundation,
  150. Inc.
  151. Written by Bruno Haible <bruno@clisp.org>, 2006.
  152. ====================COPYRIGHT====================
  153. Copyright (C) 2001, 2003-2016 Free Software Foundation, Inc.
  154. Written by Bruno Haible <bruno@clisp.org>, 2003.
  155. ====================COPYRIGHT====================
  156. Copyright (C) 2001, 2004-2006, 2009-2016 Free Software Foundation, Inc.
  157. ====================COPYRIGHT====================
  158. Copyright (C) 2001-2002, 2007, 2009-2016 Free Software Foundation, Inc.
  159. ====================COPYRIGHT====================
  160. Copyright (C) 2001-2002, 2009-2016 Free Software Foundation, Inc.
  161. ====================COPYRIGHT====================
  162. Copyright (C) 2001-2003, 2005-2007, 2009-2016 Free Software Foundation, Inc.
  163. ====================COPYRIGHT====================
  164. Copyright (C) 2001-2003, 2005-2013 Free Software Foundation, Inc.
  165. ====================COPYRIGHT====================
  166. Copyright (C) 2001-2003, 2005-2016 Free Software Foundation, Inc.
  167. Written by Bruno Haible <bruno@clisp.org>, 2001.
  168. ====================COPYRIGHT====================
  169. Copyright (C) 2001-2003, 2006, 2008-2016 Free Software Foundation, Inc.
  170. Written by Bruno Haible <haible@clisp.cons.org>, 2001.
  171. ====================COPYRIGHT====================
  172. Copyright (C) 2001-2003, 2008-2016 Free Software Foundation, Inc.
  173. Written by Bruno Haible <haible@clisp.cons.org>, 2001.
  174. ====================COPYRIGHT====================
  175. Copyright (C) 2001-2004, 2006, 2009-2016 Free Software Foundation, Inc.
  176. Written by Bruno Haible <bruno@clisp.org>, 2001.
  177. ====================COPYRIGHT====================
  178. Copyright (C) 2001-2004, 2006-2016 Free Software Foundation, Inc.
  179. Written by Bruno Haible <haible@clisp.cons.org>, 2001.
  180. ====================COPYRIGHT====================
  181. Copyright (C) 2001-2004, 2009-2016 Free Software Foundation, Inc.
  182. ====================COPYRIGHT====================
  183. Copyright (C) 2001-2016 Free Software Foundation, Inc.
  184. ====================COPYRIGHT====================
  185. Copyright (C) 2002, 2004, 2006, 2008-2016 Free Software Foundation, Inc.
  186. ====================COPYRIGHT====================
  187. Copyright (C) 2002, 2004, 2008-2016 Free Software Foundation, Inc.
  188. ====================COPYRIGHT====================
  189. Copyright (C) 2002, 2009-2016 Free Software Foundation, Inc.
  190. ====================COPYRIGHT====================
  191. Copyright (C) 2002-2003, 2005-2006, 2009-2016 Free Software Foundation, Inc.
  192. ====================COPYRIGHT====================
  193. Copyright (C) 2002-2003, 2005-2007, 2009-2016 Free Software Foundation, Inc.
  194. ====================COPYRIGHT====================
  195. Copyright (C) 2002-2004, 2006-2016 Free Software Foundation, Inc.
  196. ====================COPYRIGHT====================
  197. Copyright (C) 2002-2004, 2007-2016 Free Software Foundation, Inc.
  198. ====================COPYRIGHT====================
  199. Copyright (C) 2002-2016 Free Software Foundation, Inc.
  200. This file is part of the GNU C Library.
  201. Contributed by Isamu Hasegawa <isamu@yamato.ibm.com>.
  202. ====================COPYRIGHT====================
  203. Copyright (C) 2003, 2005, 2007, 2009-2016 Free Software Foundation, Inc.
  204. Written by Bruno Haible <bruno@clisp.org>, 2003.
  205. ====================COPYRIGHT====================
  206. Copyright (C) 2003, 2006-2007, 2009-2016 Free Software Foundation, Inc.
  207. Written by Bruno Haible <bruno@clisp.org>, 2003.
  208. ====================COPYRIGHT====================
  209. Copyright (C) 2003, 2008-2016 Free Software Foundation, Inc.
  210. ====================COPYRIGHT====================
  211. Copyright (C) 2003, 2009-2016 Free Software Foundation, Inc.
  212. ====================COPYRIGHT====================
  213. Copyright (C) 2003-2004, 2006-2016 Free Software Foundation, Inc.
  214. Written by Bruno Haible <bruno@clisp.org>, 2003.
  215. ====================COPYRIGHT====================
  216. Copyright (C) 2003-2004, 2009-2016 Free Software Foundation, Inc.
  217. Written by Bruno Haible <bruno@clisp.org>, 2003.
  218. ====================COPYRIGHT====================
  219. Copyright (C) 2003-2007, 2009-2016 Free Software Foundation, Inc.
  220. Written by Bruno Haible <bruno@clisp.org>, 2003.
  221. ====================COPYRIGHT====================
  222. Copyright (C) 2003-2013 Free Software Foundation, Inc.
  223. ====================COPYRIGHT====================
  224. Copyright (C) 2004, 2009-2016 Free Software Foundation, Inc.
  225. ====================COPYRIGHT====================
  226. Copyright (C) 2005, 2007-2016 Free Software Foundation, Inc.
  227. ====================COPYRIGHT====================
  228. Copyright (C) 2005, 2009-2016 Free Software Foundation, Inc.
  229. ====================COPYRIGHT====================
  230. Copyright (C) 2005-2006, 2009-2016 Free Software Foundation, Inc.
  231. ====================COPYRIGHT====================
  232. Copyright (C) 2005-2007, 2009-2016 Free Software Foundation, Inc.
  233. ====================COPYRIGHT====================
  234. Copyright (C) 2005-2013 Free Software Foundation, Inc.
  235. ====================COPYRIGHT====================
  236. Copyright (C) 2005-2016 Free Software Foundation, Inc.
  237. ====================COPYRIGHT====================
  238. Copyright (C) 2006, 2011-2016 Free Software Foundation, Inc.
  239. Written by Bruno Haible <bruno@clisp.org>, 2006.
  240. ====================COPYRIGHT====================
  241. Copyright (C) 2006-2013 Free Software Foundation, Inc.
  242. ====================COPYRIGHT====================
  243. Copyright (C) 2006-2016 Free Software Foundation, Inc.
  244. ====================COPYRIGHT====================
  245. Copyright (C) 2007, 2009-2016 Free Software Foundation, Inc.
  246. ====================COPYRIGHT====================
  247. Copyright (C) 2007-2008, 2010-2021 Free Software Foundation, Inc.
  248. ====================COPYRIGHT====================
  249. Copyright (C) 2007-2013 Free Software Foundation, Inc.
  250. ====================COPYRIGHT====================
  251. Copyright (C) 2007-2016 Free Software Foundation, Inc.
  252. Written by Bruno Haible <bruno@clisp.org>, 2007.
  253. ====================COPYRIGHT====================
  254. Copyright (C) 2007-2021 Free Software Foundation, Inc.
  255. ====================COPYRIGHT====================
  256. Copyright (C) 2008-2013 Free Software Foundation, Inc.
  257. ====================COPYRIGHT====================
  258. Copyright (C) 2008-2016 Free Software Foundation, Inc.
  259. ====================COPYRIGHT====================
  260. Copyright (C) 2009-2013 Free Software Foundation, Inc.
  261. ====================COPYRIGHT====================
  262. Copyright (C) 2009-2016 Free Software Foundation, Inc.
  263. ====================COPYRIGHT====================
  264. Copyright (C) 2011-2016 Free Software Foundation, Inc.
  265. ====================COPYRIGHT====================
  266. Copyright (C) 2012-2016 Free Software Foundation, Inc.
  267. ====================COPYRIGHT====================
  268. Copyright (C) 2016 Free Software Foundation, Inc.
  269. ====================COPYRIGHT====================
  270. Copyright 2013-2016 Free Software Foundation, Inc.
  271. ====================COPYRIGHT====================
  272. /* Copyright (C) 1991, 1993, 1996-1997, 1999-2000, 2003-2004, 2006, 2008-2016
  273. Free Software Foundation, Inc.
  274. ====================COPYRIGHT====================
  275. /* Copyright (C) 1991, 1994-2002, 2005, 2008-2016 Free Software Foundation,
  276. Inc.
  277. This file is part of the GNU C Library.
  278. ====================COPYRIGHT====================
  279. /* Copyright (C) 1999, 2001-2002, 2006, 2009-2016 Free Software Foundation,
  280. Inc.
  281. This file is part of the GNU C Library.
  282. ====================COPYRIGHT====================
  283. /* Copyright (C) 1999, 2001-2003, 2006-2007, 2009-2016 Free Software
  284. Foundation, Inc.
  285. This file is part of the GNU C Library.
  286. ====================COPYRIGHT====================
  287. /* Ordered set data type implemented by a binary tree.
  288. Copyright (C) 2006-2007, 2009-2016 Free Software Foundation, Inc.
  289. Written by Bruno Haible <bruno@clisp.org>, 2006.
  290. ====================COPYRIGHT====================
  291. /* Sequential list data type implemented by a hash table with a linked list.
  292. Copyright (C) 2006, 2008-2016 Free Software Foundation, Inc.
  293. Written by Bruno Haible <bruno@clisp.org>, 2006.
  294. ====================COPYRIGHT====================
  295. /* Sequential list data type implemented by a hash table with another list.
  296. Copyright (C) 2006, 2009-2016 Free Software Foundation, Inc.
  297. Written by Bruno Haible <bruno@clisp.org>, 2006.
  298. ====================COPYRIGHT====================
  299. /* Variable with FSF copyright information, for version-etc.
  300. Copyright (C) 1999-2006, 2009-2016 Free Software Foundation, Inc.
  301. ====================COPYRIGHT====================
  302. /* obstack.c - subroutines used implicitly by object stack macros
  303. Copyright (C) 1988-2016 Free Software Foundation, Inc.
  304. This file is part of the GNU C Library.
  305. ====================COPYRIGHT====================
  306. Copyright d Free Software Foundation, Inc.
  307. ====================File: lib/filenamecat-lgpl.c====================
  308. /* Concatenate two arbitrary file names.
  309. Copyright (C) 1996-2007, 2009-2016 Free Software Foundation, Inc.
  310. This program is free software: you can redistribute it and/or modify
  311. it under the terms of the GNU General Public License as published by
  312. the Free Software Foundation; either version 3 of the License, or
  313. (at your option) any later version.
  314. This program is distributed in the hope that it will be useful,
  315. but WITHOUT ANY WARRANTY; without even the implied warranty of
  316. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  317. GNU General Public License for more details.
  318. You should have received a copy of the GNU General Public License
  319. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  320. /* Written by Jim Meyering. */
  321. #include <config.h>
  322. /* Specification. */
  323. #include "filenamecat.h"
  324. #include <stdlib.h>
  325. #include <string.h>
  326. #include "dirname.h"
  327. #if ! HAVE_MEMPCPY && ! defined mempcpy
  328. # define mempcpy(D, S, N) ((void *) ((char *) memcpy (D, S, N) + (N)))
  329. #endif
  330. /* Return the longest suffix of F that is a relative file name.
  331. If it has no such suffix, return the empty string. */
  332. static char const * _GL_ATTRIBUTE_PURE
  333. longest_relative_suffix (char const *f)
  334. {
  335. for (f += FILE_SYSTEM_PREFIX_LEN (f); ISSLASH (*f); f++)
  336. continue;
  337. return f;
  338. }
  339. /* Concatenate two file name components, DIR and ABASE, in
  340. newly-allocated storage and return the result.
  341. The resulting file name F is such that the commands "ls F" and "(cd
  342. DIR; ls BASE)" refer to the same file, where BASE is ABASE with any
  343. file system prefixes and leading separators removed.
  344. Arrange for a directory separator if necessary between DIR and BASE
  345. in the result, removing any redundant separators.
  346. In any case, if BASE_IN_RESULT is non-NULL, set
  347. *BASE_IN_RESULT to point to the copy of ABASE in the returned
  348. concatenation. However, if ABASE begins with more than one slash,
  349. set *BASE_IN_RESULT to point to the sole corresponding slash that
  350. is copied into the result buffer.
  351. Return NULL if malloc fails. */
  352. char *
  353. mfile_name_concat (char const *dir, char const *abase, char **base_in_result)
  354. {
  355. char const *dirbase = last_component (dir);
  356. size_t dirbaselen = base_len (dirbase);
  357. size_t dirlen = dirbase - dir + dirbaselen;
  358. size_t needs_separator = (dirbaselen && ! ISSLASH (dirbase[dirbaselen - 1]));
  359. char const *base = longest_relative_suffix (abase);
  360. size_t baselen = strlen (base);
  361. char *p_concat = malloc (dirlen + needs_separator + baselen + 1);
  362. char *p;
  363. if (p_concat == NULL)
  364. return NULL;
  365. p = mempcpy (p_concat, dir, dirlen);
  366. *p = DIRECTORY_SEPARATOR;
  367. p += needs_separator;
  368. if (base_in_result)
  369. *base_in_result = p - IS_ABSOLUTE_FILE_NAME (abase);
  370. p = mempcpy (p, base, baselen);
  371. *p = '\0';
  372. return p_concat;
  373. }
  374. ====================File: lib/obstack.c====================
  375. /* obstack.c - subroutines used implicitly by object stack macros
  376. Copyright (C) 1988-2016 Free Software Foundation, Inc.
  377. This file is part of the GNU C Library.
  378. The GNU C Library is free software; you can redistribute it and/or
  379. modify it under the terms of the GNU General Public
  380. License as published by the Free Software Foundation; either
  381. version 3 of the License, or (at your option) any later version.
  382. The GNU C Library is distributed in the hope that it will be useful,
  383. but WITHOUT ANY WARRANTY; without even the implied warranty of
  384. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  385. General Public License for more details.
  386. You should have received a copy of the GNU General Public
  387. License along with the GNU C Library; if not, see
  388. <http://www.gnu.org/licenses/>. */
  389. #ifdef _LIBC
  390. # include <obstack.h>
  391. #else
  392. # include <config.h>
  393. # include "obstack.h"
  394. #endif
  395. /* NOTE BEFORE MODIFYING THIS FILE: _OBSTACK_INTERFACE_VERSION in
  396. obstack.h must be incremented whenever callers compiled using an old
  397. obstack.h can no longer properly call the functions in this file. */
  398. /* Comment out all this code if we are using the GNU C Library, and are not
  399. actually compiling the library itself, and the installed library
  400. supports the same library interface we do. This code is part of the GNU
  401. C Library, but also included in many other GNU distributions. Compiling
  402. and linking in this code is a waste when using the GNU C library
  403. (especially if it is a shared library). Rather than having every GNU
  404. program understand 'configure --with-gnu-libc' and omit the object
  405. files, it is simpler to just do this in the source for each such file. */
  406. #if !defined _LIBC && defined __GNU_LIBRARY__ && __GNU_LIBRARY__ > 1
  407. # include <gnu-versions.h>
  408. # if (_GNU_OBSTACK_INTERFACE_VERSION == _OBSTACK_INTERFACE_VERSION \
  409. || (_GNU_OBSTACK_INTERFACE_VERSION == 1 \
  410. && _OBSTACK_INTERFACE_VERSION == 2 \
  411. && defined SIZEOF_INT && defined SIZEOF_SIZE_T \
  412. && SIZEOF_INT == SIZEOF_SIZE_T))
  413. # define _OBSTACK_ELIDE_CODE
  414. # endif
  415. #endif
  416. #ifndef _OBSTACK_ELIDE_CODE
  417. /* If GCC, or if an oddball (testing?) host that #defines __alignof__,
  418. use the already-supplied __alignof__. Otherwise, this must be Gnulib
  419. (as glibc assumes GCC); defer to Gnulib's alignof_type. */
  420. # include <stdlib.h>
  421. # include <stdint.h>
  422. # ifndef MAX
  423. # define MAX(a,b) ((a) > (b) ? (a) : (b))
  424. # endif
  425. /* Determine default alignment. */
  426. /* If malloc were really smart, it would round addresses to DEFAULT_ALIGNMENT.
  427. But in fact it might be less smart and round addresses to as much as
  428. DEFAULT_ROUNDING. So we prepare for it to do that.
  429. DEFAULT_ALIGNMENT cannot be an enum constant; see gnulib's alignof.h. */
  430. #define DEFAULT_ALIGNMENT MAX (__alignof__ (long double), \
  431. MAX (__alignof__ (uintmax_t), \
  432. __alignof__ (void *)))
  433. #define DEFAULT_ROUNDING MAX (sizeof (long double), \
  434. MAX (sizeof (uintmax_t), \
  435. sizeof (void *)))
  436. /* Call functions with either the traditional malloc/free calling
  437. interface, or the mmalloc/mfree interface (that adds an extra first
  438. argument), based on the value of use_extra_arg. */
  439. static void *
  440. call_chunkfun (struct obstack *h, size_t size)
  441. {
  442. if (h->use_extra_arg)
  443. return h->chunkfun.extra (h->extra_arg, size);
  444. else
  445. return h->chunkfun.plain (size);
  446. }
  447. static void
  448. call_freefun (struct obstack *h, void *old_chunk)
  449. {
  450. if (h->use_extra_arg)
  451. h->freefun.extra (h->extra_arg, old_chunk);
  452. else
  453. h->freefun.plain (old_chunk);
  454. }
  455. /* Initialize an obstack H for use. Specify chunk size SIZE (0 means default).
  456. Objects start on multiples of ALIGNMENT (0 means use default).
  457. Return nonzero if successful, calls obstack_alloc_failed_handler if
  458. allocation fails. */
  459. static int
  460. _obstack_begin_worker (struct obstack *h,
  461. _OBSTACK_SIZE_T size, _OBSTACK_SIZE_T alignment)
  462. {
  463. struct _obstack_chunk *chunk; /* points to new chunk */
  464. if (alignment == 0)
  465. alignment = DEFAULT_ALIGNMENT;
  466. if (size == 0)
  467. /* Default size is what GNU malloc can fit in a 4096-byte block. */
  468. {
  469. /* 12 is sizeof (mhead) and 4 is EXTRA from GNU malloc.
  470. Use the values for range checking, because if range checking is off,
  471. the extra bytes won't be missed terribly, but if range checking is on
  472. and we used a larger request, a whole extra 4096 bytes would be
  473. allocated.
  474. These number are irrelevant to the new GNU malloc. I suspect it is
  475. less sensitive to the size of the request. */
  476. int extra = ((((12 + DEFAULT_ROUNDING - 1) & ~(DEFAULT_ROUNDING - 1))
  477. + 4 + DEFAULT_ROUNDING - 1)
  478. & ~(DEFAULT_ROUNDING - 1));
  479. size = 4096 - extra;
  480. }
  481. h->chunk_size = size;
  482. h->alignment_mask = alignment - 1;
  483. chunk = h->chunk = call_chunkfun (h, h->chunk_size);
  484. if (!chunk)
  485. (*obstack_alloc_failed_handler) ();
  486. h->next_free = h->object_base = __PTR_ALIGN ((char *) chunk, chunk->contents,
  487. alignment - 1);
  488. h->chunk_limit = chunk->limit = (char *) chunk + h->chunk_size;
  489. chunk->prev = 0;
  490. /* The initial chunk now contains no empty object. */
  491. h->maybe_empty_object = 0;
  492. h->alloc_failed = 0;
  493. return 1;
  494. }
  495. int
  496. _obstack_begin (struct obstack *h,
  497. _OBSTACK_SIZE_T size, _OBSTACK_SIZE_T alignment,
  498. void *(*chunkfun) (size_t),
  499. void (*freefun) (void *))
  500. {
  501. h->chunkfun.plain = chunkfun;
  502. h->freefun.plain = freefun;
  503. h->use_extra_arg = 0;
  504. return _obstack_begin_worker (h, size, alignment);
  505. }
  506. int
  507. _obstack_begin_1 (struct obstack *h,
  508. _OBSTACK_SIZE_T size, _OBSTACK_SIZE_T alignment,
  509. void *(*chunkfun) (void *, size_t),
  510. void (*freefun) (void *, void *),
  511. void *arg)
  512. {
  513. h->chunkfun.extra = chunkfun;
  514. h->freefun.extra = freefun;
  515. h->extra_arg = arg;
  516. h->use_extra_arg = 1;
  517. return _obstack_begin_worker (h, size, alignment);
  518. }
  519. /* Allocate a new current chunk for the obstack *H
  520. on the assumption that LENGTH bytes need to be added
  521. to the current object, or a new object of length LENGTH allocated.
  522. Copies any partial object from the end of the old chunk
  523. to the beginning of the new one. */
  524. void
  525. _obstack_newchunk (struct obstack *h, _OBSTACK_SIZE_T length)
  526. {
  527. struct _obstack_chunk *old_chunk = h->chunk;
  528. struct _obstack_chunk *new_chunk = 0;
  529. size_t obj_size = h->next_free - h->object_base;
  530. char *object_base;
  531. /* Compute size for new chunk. */
  532. size_t sum1 = obj_size + length;
  533. size_t sum2 = sum1 + h->alignment_mask;
  534. size_t new_size = sum2 + (obj_size >> 3) + 100;
  535. if (new_size < sum2)
  536. new_size = sum2;
  537. if (new_size < h->chunk_size)
  538. new_size = h->chunk_size;
  539. /* Allocate and initialize the new chunk. */
  540. if (obj_size <= sum1 && sum1 <= sum2)
  541. new_chunk = call_chunkfun (h, new_size);
  542. if (!new_chunk)
  543. (*obstack_alloc_failed_handler)();
  544. h->chunk = new_chunk;
  545. new_chunk->prev = old_chunk;
  546. new_chunk->limit = h->chunk_limit = (char *) new_chunk + new_size;
  547. /* Compute an aligned object_base in the new chunk */
  548. object_base =
  549. __PTR_ALIGN ((char *) new_chunk, new_chunk->contents, h->alignment_mask);
  550. /* Move the existing object to the new chunk. */
  551. memcpy (object_base, h->object_base, obj_size);
  552. /* If the object just copied was the only data in OLD_CHUNK,
  553. free that chunk and remove it from the chain.
  554. But not if that chunk might contain an empty object. */
  555. if (!h->maybe_empty_object
  556. && (h->object_base
  557. == __PTR_ALIGN ((char *) old_chunk, old_chunk->contents,
  558. h->alignment_mask)))
  559. {
  560. new_chunk->prev = old_chunk->prev;
  561. call_freefun (h, old_chunk);
  562. }
  563. h->object_base = object_base;
  564. h->next_free = h->object_base + obj_size;
  565. /* The new chunk certainly contains no empty object yet. */
  566. h->maybe_empty_object = 0;
  567. }
  568. /* Return nonzero if object OBJ has been allocated from obstack H.
  569. This is here for debugging.
  570. If you use it in a program, you are probably losing. */
  571. /* Suppress -Wmissing-prototypes warning. We don't want to declare this in
  572. obstack.h because it is just for debugging. */
  573. int _obstack_allocated_p (struct obstack *h, void *obj) __attribute_pure__;
  574. int
  575. _obstack_allocated_p (struct obstack *h, void *obj)
  576. {
  577. struct _obstack_chunk *lp; /* below addr of any objects in this chunk */
  578. struct _obstack_chunk *plp; /* point to previous chunk if any */
  579. lp = (h)->chunk;
  580. /* We use >= rather than > since the object cannot be exactly at
  581. the beginning of the chunk but might be an empty object exactly
  582. at the end of an adjacent chunk. */
  583. while (lp != 0 && ((void *) lp >= obj || (void *) (lp)->limit < obj))
  584. {
  585. plp = lp->prev;
  586. lp = plp;
  587. }
  588. return lp != 0;
  589. }
  590. /* Free objects in obstack H, including OBJ and everything allocate
  591. more recently than OBJ. If OBJ is zero, free everything in H. */
  592. void
  593. _obstack_free (struct obstack *h, void *obj)
  594. {
  595. struct _obstack_chunk *lp; /* below addr of any objects in this chunk */
  596. struct _obstack_chunk *plp; /* point to previous chunk if any */
  597. lp = h->chunk;
  598. /* We use >= because there cannot be an object at the beginning of a chunk.
  599. But there can be an empty object at that address
  600. at the end of another chunk. */
  601. while (lp != 0 && ((void *) lp >= obj || (void *) (lp)->limit < obj))
  602. {
  603. plp = lp->prev;
  604. call_freefun (h, lp);
  605. lp = plp;
  606. /* If we switch chunks, we can't tell whether the new current
  607. chunk contains an empty object, so assume that it may. */
  608. h->maybe_empty_object = 1;
  609. }
  610. if (lp)
  611. {
  612. h->object_base = h->next_free = (char *) (obj);
  613. h->chunk_limit = lp->limit;
  614. h->chunk = lp;
  615. }
  616. else if (obj != 0)
  617. /* obj is not in any of the chunks! */
  618. abort ();
  619. }
  620. _OBSTACK_SIZE_T
  621. _obstack_memory_used (struct obstack *h)
  622. {
  623. struct _obstack_chunk *lp;
  624. _OBSTACK_SIZE_T nbytes = 0;
  625. for (lp = h->chunk; lp != 0; lp = lp->prev)
  626. {
  627. nbytes += lp->limit - (char *) lp;
  628. }
  629. return nbytes;
  630. }
  631. # ifndef _OBSTACK_NO_ERROR_HANDLER
  632. /* Define the error handler. */
  633. # include <stdio.h>
  634. /* Exit value used when 'print_and_abort' is used. */
  635. # ifdef _LIBC
  636. int obstack_exit_failure = EXIT_FAILURE;
  637. # else
  638. # include "exitfail.h"
  639. # define obstack_exit_failure exit_failure
  640. # endif
  641. # ifdef _LIBC
  642. # include <libintl.h>
  643. # else
  644. # include "gettext.h"
  645. # endif
  646. # ifndef _
  647. # define _(msgid) gettext (msgid)
  648. # endif
  649. # ifdef _LIBC
  650. # error #include <libio/iolibio.h>
  651. # endif
  652. static _Noreturn void
  653. print_and_abort (void)
  654. {
  655. /* Don't change any of these strings. Yes, it would be possible to add
  656. the newline to the string and use fputs or so. But this must not
  657. happen because the "memory exhausted" message appears in other places
  658. like this and the translation should be reused instead of creating
  659. a very similar string which requires a separate translation. */
  660. # ifdef _LIBC
  661. (void) __fxprintf (NULL, "%s\n", _("memory exhausted"));
  662. # else
  663. fprintf (stderr, "%s\n", _("memory exhausted"));
  664. # endif
  665. exit (obstack_exit_failure);
  666. }
  667. /* The functions allocating more room by calling 'obstack_chunk_alloc'
  668. jump to the handler pointed to by 'obstack_alloc_failed_handler'.
  669. This can be set to a user defined function which should either
  670. abort gracefully or use longjump - but shouldn't return. This
  671. variable by default points to the internal function
  672. 'print_and_abort'. */
  673. __attribute_noreturn__ void (*obstack_alloc_failed_handler) (void)
  674. = print_and_abort;
  675. # endif /* !_OBSTACK_NO_ERROR_HANDLER */
  676. #endif /* !_OBSTACK_ELIDE_CODE */
  677. ====================GPL-3.0-or-later====================
  678. This program is free software: you can redistribute it and/or modify
  679. it under the terms of the GNU General Public License as published by
  680. the Free Software Foundation; either version 3 of the License, or
  681. (at your option) any later version.
  682. This program is distributed in the hope that it will be useful,
  683. but WITHOUT ANY WARRANTY; without even the implied warranty of
  684. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  685. GNU General Public License for more details.
  686. You should have received a copy of the GNU General Public License
  687. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  688. ====================GPL-3.0-or-later====================
  689. The GNU C Library is free software; you can redistribute it and/or
  690. modify it under the terms of the GNU General Public
  691. License as published by the Free Software Foundation; either
  692. version 3 of the License, or (at your option) any later version.
  693. The GNU C Library is distributed in the hope that it will be useful,
  694. but WITHOUT ANY WARRANTY; without even the implied warranty of
  695. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  696. General Public License for more details.
  697. You should have received a copy of the GNU General Public
  698. License along with the GNU C Library; if not, see
  699. <http://www.gnu.org/licenses/>. */
  700. ====================GPL-3.0-or-later====================
  701. This program is free software: you can redistribute it and/or modify
  702. it under the terms of the GNU General Public License as published by
  703. the Free Software Foundation; either version 3 of the License, or
  704. (at your option) any later version.
  705. This program is distributed in the hope that it will be useful,
  706. but WITHOUT ANY WARRANTY; without even the implied warranty of
  707. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  708. GNU General Public License for more details.
  709. You should have received a copy of the GNU General Public License
  710. along with this program. If not, see <http://www.gnu.org/licenses/>.
  711. ====================GPL-3.0-or-later====================
  712. This program is free software: you can redistribute it and/or modify
  713. it under the terms of the GNU General Public License as published by
  714. the Free Software Foundation; either version 3 of the License, or
  715. (at your option) any later version.
  716. This program is distributed in the hope that it will be useful,
  717. but WITHOUT ANY WARRANTY; without even the implied warranty of
  718. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  719. GNU General Public License for more details.
  720. You should have received a copy of the GNU General Public License
  721. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  722. ====================GPL-3.0-or-later====================
  723. This program is free software: you can redistribute it and/or modify
  724. it under the terms of the GNU General Public License as published by
  725. the Free Software Foundation; either version 3 of the License, or
  726. (at your option) any later version.
  727. This program is distributed in the hope that it will be useful,
  728. but WITHOUT ANY WARRANTY; without even the implied warranty of
  729. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  730. GNU General Public License for more details.
  731. You should have received a copy of the GNU General Public License
  732. along with this program. If not, see <https://www.gnu.org/licenses/>. */
  733. ====================GPL-3.0-or-later====================
  734. This program is free software: you can redistribute it and/or modify it
  735. under the terms of the GNU General Public License as published
  736. by the Free Software Foundation; either version 3 of the License, or
  737. (at your option) any later version.
  738. This program is distributed in the hope that it will be useful,
  739. but WITHOUT ANY WARRANTY; without even the implied warranty of
  740. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  741. GNU General Public License for more details.
  742. You should have received a copy of the GNU General Public License
  743. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  744. ====================GPL-3.0-or-later====================
  745. This program is free software: you can redistribute it and/or modify it
  746. under the terms of the GNU General Public License as published
  747. by the Free Software Foundation; either version 3 of the License, or
  748. (at your option) any later version.
  749. This program is distributed in the hope that it will be useful,
  750. but WITHOUT ANY WARRANTY; without even the implied warranty of
  751. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  752. General Public License for more details.
  753. You should have received a copy of the GNU General Public License
  754. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  755. ====================GPL-3.0-or-later====================
  756. This program is free software; you can redistribute it and/or modify
  757. it under the terms of the GNU General Public License as published by
  758. the Free Software Foundation; either version 3, or (at your option)
  759. any later version.
  760. This program is distributed in the hope that it will be useful,
  761. but WITHOUT ANY WARRANTY; without even the implied warranty of
  762. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  763. GNU General Public License for more details.
  764. You should have received a copy of the GNU General Public License
  765. along with this program; if not, see <http://www.gnu.org/licenses/>. */
  766. ====================GPL-3.0-or-later====================
  767. This program is free software; you can redistribute it and/or modify
  768. it under the terms of the GNU General Public License as published by
  769. the Free Software Foundation; either version 3, or (at your option)
  770. any later version.
  771. This program is distributed in the hope that it will be useful,
  772. but WITHOUT ANY WARRANTY; without even the implied warranty of
  773. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  774. GNU General Public License for more details.
  775. You should have received a copy of the GNU General Public License along
  776. with this program; if not, see <http://www.gnu.org/licenses/>. */
  777. ====================GPL-3.0-or-later====================
  778. This program is free software; you can redistribute it and/or modify
  779. it under the terms of the GNU General Public License as published by
  780. the Free Software Foundation; either version 3, or (at your option)
  781. any later version.
  782. This program is distributed in the hope that it will be useful,
  783. but WITHOUT ANY WARRANTY; without even the implied warranty of
  784. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  785. GNU General Public License for more details.
  786. You should have received a copy of the GNU General Public License along
  787. with this program; if not, see <https://www.gnu.org/licenses/>. */
  788. ====================GPL-3.0-or-later====================
  789. This program is free software; you can redistribute it and/or modify it
  790. under the terms of the GNU General Public License as published
  791. by the Free Software Foundation; either version 3, or (at your option)
  792. any later version.
  793. This program is distributed in the hope that it will be useful,
  794. but WITHOUT ANY WARRANTY; without even the implied warranty of
  795. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  796. General Public License for more details.
  797. You should have received a copy of the GNU General Public
  798. License along with this program; if not, see
  799. <http://www.gnu.org/licenses/>.
  800. ====================GPL-3.0-or-later====================
  801. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.\n\
  802. This is free software: you are free to change and redistribute it.\n\
  803. There is NO WARRANTY, to the extent permitted by law.\n\
  804. ====================GPL-3.0-or-later====================
  805. This program is free software: you can redistribute it and/or modify it
  806. under the terms of the GNU General Public License as published by the
  807. Free Software Foundation; either version 3 of the License, or any
  808. later version.
  809. This program is distributed in the hope that it will be useful,
  810. but WITHOUT ANY WARRANTY; without even the implied warranty of
  811. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  812. GNU General Public License for more details.
  813. You should have received a copy of the GNU General Public License
  814. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  815. ====================GPL-3.0-or-later====================
  816. This program is free software; you can redistribute it and/or modify
  817. it under the terms of the GNU General Public License as published by
  818. the Free Software Foundation; either version 3 of the License, or
  819. (at your option) any later version.
  820. This program is distributed in the hope that it will be useful,
  821. but WITHOUT ANY WARRANTY; without even the implied warranty of
  822. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  823. GNU General Public License for more details.
  824. You should have received a copy of the GNU General Public License
  825. along with this program; if not, see <http://www.gnu.org/licenses/>. */
  826. ====================LGPL-2.0-or-later====================
  827. /* Just like mfile_name_concat (filenamecat-lgpl.c), except, rather than