redcarpet 3.3.2 → 3.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 4549cbe772995b6ab432142d20b4e4de5c45229c
4
- data.tar.gz: b80438cae22fe723e749a432fcaaa7656f7f660b
2
+ SHA256:
3
+ metadata.gz: 3e6ea78031a1e40620168cd57fcbfae06bec5bafabc8f6e600adc552a4fe5b40
4
+ data.tar.gz: 658dd33e836daa11effa88e0491d09387963ea349751efd278e9fbdac7026066
5
5
  SHA512:
6
- metadata.gz: 0a04dd8f57fdeb53ecb79c28e680915c607d6e4b95b7888b7b3bc86ea1729d9b1aeccf710b00d1849989ce940aaccdc126e796d17acbbdd3ca3e8b924e756673
7
- data.tar.gz: fe26df7e15e06d3a34e5a253000d5cfc8c0c77e2b5cd56ad04f0484af90349bfbb84e1b5d80df3ac189a3509c1b46d8f56e9f8d4033b00350410775856f6d63a
6
+ metadata.gz: b17b0208c25d4e8566fb4a154d0f66e778b702abcf58d1d1227fa2510be421c7496e20fd6402066adba3485778e935b46aff73fd412802eedb89e44470a7ad94
7
+ data.tar.gz: 1e1c8dd559979b8bd5f4de2d20e1127b2a964c03a267133c3d9a3703f71bce44a2f4dc2efdb0dc0cc331e0ab779bfad23e9b62af0ffc4ee9078896376bd86865
data/COPYING CHANGED
@@ -1,14 +1,20 @@
1
1
  Copyright (c) 2009, Natacha Porté
2
- Copyright (c) 2011, Vicent Marti
2
+ Copyright (c) 2015, Vicent Marti
3
3
 
4
- Permission to use, copy, modify, and distribute this software for any
5
- purpose with or without fee is hereby granted, provided that the above
6
- copyright notice and this permission notice appear in all copies.
4
+ Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ of this software and associated documentation files (the "Software"), to deal
6
+ in the Software without restriction, including without limitation the rights
7
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ copies of the Software, and to permit persons to whom the Software is
9
+ furnished to do so, subject to the following conditions:
7
10
 
8
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9
- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10
- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11
- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12
- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13
- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14
- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
11
+ The above copyright notice and this permission notice shall be included in
12
+ all copies or substantial portions of the Software.
13
+
14
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
+ THE SOFTWARE.
data/Gemfile CHANGED
@@ -3,7 +3,7 @@ source "https://rubygems.org/"
3
3
  gemspec
4
4
 
5
5
  group :benchmark do
6
- gem "benchmark-ips", "~> 1.2.0"
6
+ gem "benchmark-ips", "~> 2.7.2"
7
7
  gem "bluecloth", "~> 2.2.0"
8
- gem "kramdown", "~> 1.0.2"
8
+ gem "kramdown", "~> 1.13.2"
9
9
  end
@@ -2,6 +2,8 @@ Redcarpet is written with sugar, spice and everything nice
2
2
  ============================================================
3
3
 
4
4
  [![Build Status](https://travis-ci.org/vmg/redcarpet.svg?branch=master)](https://travis-ci.org/vmg/redcarpet)
5
+ [![Dependency Status](https://www.versioneye.com/ruby/redcarpet/badge.svg)](https://www.versioneye.com/ruby/redcarpet)
6
+ [![Help Contribute to Open Source](https://www.codetriage.com/vmg/redcarpet/badges/users.svg)](https://www.codetriage.com/vmg/redcarpet)
5
7
 
6
8
  Redcarpet is a Ruby library for Markdown processing that smells like
7
9
  butterflies and popcorn.
@@ -24,7 +26,7 @@ Starting with Redcarpet 3.0, the minimum required Ruby version is 1.9.2 (or Rubi
24
26
 
25
27
  $ [sudo] gem install redcarpet
26
28
 
27
- If you need to use it with Ruby 1.8.7, you will need to stick with 2.3.0:
29
+ If you need to use it with Ruby 1.8.7, you will have to stick with 2.3.0:
28
30
 
29
31
  $ [sudo] gem install redcarpet -v 2.3.0
30
32
 
@@ -44,10 +46,10 @@ output.
44
46
  The `Redcarpet::Markdown` object is encouraged to be instantiated once with the
45
47
  required settings, and reused between parses.
46
48
 
47
- ~~~~~ ruby
49
+ ~~~~ ruby
48
50
  # Initializes a Markdown parser
49
51
  markdown = Redcarpet::Markdown.new(renderer, extensions = {})
50
- ~~~~~
52
+ ~~~~
51
53
 
52
54
  Here, the `renderer` variable refers to a renderer object, inheriting
53
55
  from `Redcarpet::Render::Base`. If the given object has not been
@@ -58,10 +60,10 @@ Unlike in the RedCloth API, the text to render is passed as an argument
58
60
  and not stored inside the `Markdown` instance, to encourage reusability.
59
61
  Example:
60
62
 
61
- ~~~~~ ruby
63
+ ~~~~ ruby
62
64
  markdown.render("This is *bongos*, indeed.")
63
65
  # => "<p>This is <em>bongos</em>, indeed.</p>"
64
- ~~~~~
66
+ ~~~~
65
67
 
66
68
  You can also specify a hash containing the Markdown extensions which the
67
69
  parser will identify. The following extensions are accepted:
@@ -83,7 +85,7 @@ but starting with `www` are also handled.
83
85
 
84
86
  * `:disable_indented_code_blocks`: do not parse usual markdown
85
87
  code blocks. Markdown converts text with four spaces at
86
- the front of each line to code blocks. This options
88
+ the front of each line to code blocks. This option
87
89
  prevents it from doing so. Recommended to use
88
90
  with `fenced_code_blocks: true`.
89
91
 
@@ -118,9 +120,9 @@ within the document (e.g. `[^1]: This is a footnote.`).
118
120
 
119
121
  Example:
120
122
 
121
- ~~~ruby
123
+ ~~~~ ruby
122
124
  markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, autolink: true, tables: true)
123
- ~~~~~
125
+ ~~~~
124
126
 
125
127
  Darling, I packed you a couple renderers for lunch
126
128
  --------------------------------------------------
@@ -135,9 +137,9 @@ All the rendering flags that previously applied only to HTML output have
135
137
  now been moved to the `Redcarpet::Render::HTML` class, and may be enabled when
136
138
  instantiating the renderer:
137
139
 
138
- ~~~~~ ruby
140
+ ~~~~ ruby
139
141
  Redcarpet::Render::HTML.new(render_options = {})
140
- ~~~~~
142
+ ~~~~
141
143
 
142
144
  Initializes an HTML renderer. The following flags are available:
143
145
 
@@ -159,7 +161,7 @@ safe.
159
161
  * `:with_toc_data`: add HTML anchors to each header in the output HTML,
160
162
  to allow linking to each section.
161
163
 
162
- * `:hard_wrap`: insert HTML `<br>` tags inside on paragraphs where the origin
164
+ * `:hard_wrap`: insert HTML `<br>` tags inside paragraphs where the original
163
165
  Markdown document had newlines (by default, Markdown ignores these newlines).
164
166
 
165
167
  * `:xhtml`: output XHTML-conformant tags. This option is always enabled in the
@@ -171,9 +173,9 @@ Markdown document had newlines (by default, Markdown ignores these newlines).
171
173
 
172
174
  Example:
173
175
 
174
- ~~~~~ ruby
176
+ ~~~~ ruby
175
177
  renderer = Redcarpet::Render::HTML.new(no_links: true, hard_wrap: true)
176
- ~~~~~
178
+ ~~~~
177
179
 
178
180
 
179
181
  The `HTML` renderer has an alternate version, `Redcarpet::Render::HTML_TOC`,
@@ -181,12 +183,21 @@ which will output a table of contents in HTML based on the headers of the
181
183
  Markdown document.
182
184
 
183
185
  When instantiating this render object, you can optionally pass a `nesting_level`
184
- option which takes an integer and allows you to make it render only headers
185
- until a specific level.
186
+ option which takes an integer or a range and allows you to make it render only
187
+ headers at certain levels.
186
188
 
187
- Furthermore, the abstract base class `Redcarpet::Render::Base` can be used
188
- to write a custom renderer purely in Ruby, or extending an existing renderer.
189
- See the following section for more information.
189
+ Redcarpet also includes a plaintext renderer, `Redcarpet::Render::StripDown`, that
190
+ strips out all the formatting:
191
+
192
+ ~~~~ ruby
193
+ require 'redcarpet'
194
+ require 'redcarpet/render_strip'
195
+
196
+ markdown = Redcarpet::Markdown.new(Redcarpet::Render::StripDown)
197
+
198
+ markdown.render("**This** _is_ an [example](http://example.org/).")
199
+ # => "This is an example (http://example.org/)."
200
+ ~~~~
190
201
 
191
202
 
192
203
  And you can even cook your own
@@ -195,25 +206,26 @@ And you can even cook your own
195
206
  Custom renderers are created by inheriting from an existing renderer. The
196
207
  built-in renderers, `HTML` and `XHTML` may be extended as such:
197
208
 
198
- ~~~~~ ruby
199
- # create a custom renderer that allows highlighting of code blocks
200
- class HTMLwithPygments < Redcarpet::Render::HTML
201
- def block_code(code, language)
202
- Pygments.highlight(code, lexer: language)
209
+ ~~~~ ruby
210
+ # Create a custom renderer that sets a custom class for block-quotes.
211
+ class CustomRender < Redcarpet::Render::HTML
212
+ def block_quote(quote)
213
+ %(<blockquote class="my-custom-class">#{quote}</blockquote>)
203
214
  end
204
215
  end
205
216
 
206
- markdown = Redcarpet::Markdown.new(HTMLwithPygments, fenced_code_blocks: true)
207
- ~~~~~
217
+ markdown = Redcarpet::Markdown.new(CustomRender, fenced_code_blocks: true)
218
+ ~~~~
208
219
 
209
- But new renderers can also be created from scratch (see `lib/redcarpet/render_man.rb` for
210
- an example implementation of a Manpage renderer)
220
+ But new renderers can also be created from scratch by extending the abstract
221
+ base class `Redcarpet::Render::Base` (see `lib/redcarpet/render_man.rb` for
222
+ an example implementation of a Manpage renderer):
211
223
 
212
- ~~~~~~ ruby
224
+ ~~~~ ruby
213
225
  class ManPage < Redcarpet::Render::Base
214
226
  # you get the drill -- keep going from here
215
227
  end
216
- ~~~~~
228
+ ~~~~
217
229
 
218
230
  The following instance methods may be implemented by the renderer:
219
231
 
@@ -301,7 +313,7 @@ or after the rendering process begins:
301
313
  * postprocess(full_document)
302
314
 
303
315
  You can look at
304
- ["How to extend the Redcarpet 2 Markdown library?"](http://dev.af83.com/2012/02/27/howto-extend-the-redcarpet2-markdown-lib.html)
316
+ ["How to extend the Redcarpet 2 Markdown library?"](https://web.archive.org/web/20170505231254/http://dev.af83.com/2012/02/27/howto-extend-the-redcarpet2-markdown-lib.html)
305
317
  for some more explanations.
306
318
 
307
319
  Also, now our Pants are much smarter
@@ -326,7 +338,7 @@ end
326
338
 
327
339
  # Standalone
328
340
  Redcarpet::Render::SmartyPants.render("<p>Oh SmartyPants, you're so crazy...</p>")
329
- ~~~~~
341
+ ~~~~
330
342
 
331
343
  SmartyPants works on top of already-rendered HTML, and will ignore replacements
332
344
  inside the content of HTML tags and inside specific HTML blocks such as
@@ -351,16 +363,16 @@ renderer-independent, the results will be completely unreliable!
351
363
  Still, if major forces (let's say, tornadoes or other natural disasters) force you
352
364
  to keep a Markdown-compatibility layer, Redcarpet also supports this:
353
365
 
354
- ~~~~~ ruby
366
+ ~~~~ ruby
355
367
  require 'redcarpet/compat'
356
- ~~~~~
368
+ ~~~~
357
369
 
358
370
  Requiring the compatibility library will declare a `Markdown` class with the
359
371
  classical RedCloth API, e.g.
360
372
 
361
- ~~~~~ ruby
373
+ ~~~~ ruby
362
374
  Markdown.new('this is my text').to_html
363
- ~~~~~
375
+ ~~~~
364
376
 
365
377
  This class renders 100% standards compliant Markdown with 0 extensions. Nada.
366
378
  Don't even try to enable extensions with a compatibility layer, because
@@ -372,16 +384,22 @@ monkeypatches the Markdown class, you're a terrible human being. Just saying.
372
384
  Boring legal stuff
373
385
  ------------------
374
386
 
375
- Copyright (c) 2011-2014, Vicent Martí
376
-
377
- Permission to use, copy, modify, and/or distribute this software for any
378
- purpose with or without fee is hereby granted, provided that the above
379
- copyright notice and this permission notice appear in all copies.
380
-
381
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
382
- WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
383
- MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
384
- ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
385
- WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
386
- ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
387
- OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
387
+ Copyright (c) 2011-2016, Vicent Martí
388
+
389
+ Permission is hereby granted, free of charge, to any person obtaining a copy
390
+ of this software and associated documentation files (the "Software"), to deal
391
+ in the Software without restriction, including without limitation the rights
392
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
393
+ copies of the Software, and to permit persons to whom the Software is
394
+ furnished to do so, subject to the following conditions:
395
+
396
+ The above copyright notice and this permission notice shall be included in
397
+ all copies or substantial portions of the Software.
398
+
399
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
400
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
401
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
402
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
403
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
404
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
405
+ THE SOFTWARE.
@@ -1,17 +1,23 @@
1
1
  /*
2
- * Copyright (c) 2011, Vicent Marti
2
+ * Copyright (c) 2015, Vicent Marti
3
3
  *
4
- * Permission to use, copy, modify, and distribute this software for any
5
- * purpose with or without fee is hereby granted, provided that the above
6
- * copyright notice and this permission notice appear in all copies.
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
7
10
  *
8
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
+ * THE SOFTWARE.
15
21
  */
16
22
 
17
23
  #include "buffer.h"
@@ -288,9 +294,15 @@ sd_autolink__url(
288
294
  if (link_end == 0)
289
295
  return 0;
290
296
 
297
+ /**
298
+ * In certain cases, we may refer to a link at the end of a
299
+ * sentence so the period should not be part of the URL.
300
+ */
301
+ if (data[link_end - 1] == '.')
302
+ link_end--;
303
+
291
304
  bufput(link, data - rewind, link_end + rewind);
292
305
  *rewind_p = rewind;
293
306
 
294
307
  return link_end;
295
308
  }
296
-
@@ -1,17 +1,23 @@
1
1
  /*
2
- * Copyright (c) 2011, Vicent Marti
2
+ * Copyright (c) 2015, Vicent Marti
3
3
  *
4
- * Permission to use, copy, modify, and distribute this software for any
5
- * purpose with or without fee is hereby granted, provided that the above
6
- * copyright notice and this permission notice appear in all copies.
4
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ * of this software and associated documentation files (the "Software"), to deal
6
+ * in the Software without restriction, including without limitation the rights
7
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ * copies of the Software, and to permit persons to whom the Software is
9
+ * furnished to do so, subject to the following conditions:
7
10
  *
8
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
11
+ * The above copyright notice and this permission notice shall be included in
12
+ * all copies or substantial portions of the Software.
13
+ *
14
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
+ * THE SOFTWARE.
15
21
  */
16
22
 
17
23
  #ifndef AUTOLINK_H__
@@ -1,21 +1,28 @@
1
1
  /*
2
2
  * Copyright (c) 2008, Natacha Porté
3
- * Copyright (c) 2011, Vicent Martí
3
+ * Copyright (c) 2015, Vicent Marti
4
4
  *
5
- * Permission to use, copy, modify, and distribute this software for any
6
- * purpose with or without fee is hereby granted, provided that the above
7
- * copyright notice and this permission notice appear in all copies.
5
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ * of this software and associated documentation files (the "Software"), to deal
7
+ * in the Software without restriction, including without limitation the rights
8
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ * copies of the Software, and to permit persons to whom the Software is
10
+ * furnished to do so, subject to the following conditions:
8
11
  *
9
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
12
+ * The above copyright notice and this permission notice shall be included in
13
+ * all copies or substantial portions of the Software.
14
+ *
15
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ * THE SOFTWARE.
16
22
  */
17
23
 
18
24
  #define BUFFER_MAX_ALLOC_SIZE (1024 * 1024 * 16) //16mb
25
+ #define __USE_MINGW_ANSI_STDIO 1
19
26
 
20
27
  #include "buffer.h"
21
28
 
@@ -1,18 +1,24 @@
1
1
  /*
2
2
  * Copyright (c) 2008, Natacha Porté
3
- * Copyright (c) 2011, Vicent Martí
3
+ * Copyright (c) 2015, Vicent Marti
4
4
  *
5
- * Permission to use, copy, modify, and distribute this software for any
6
- * purpose with or without fee is hereby granted, provided that the above
7
- * copyright notice and this permission notice appear in all copies.
5
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ * of this software and associated documentation files (the "Software"), to deal
7
+ * in the Software without restriction, including without limitation the rights
8
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ * copies of the Software, and to permit persons to whom the Software is
10
+ * furnished to do so, subject to the following conditions:
8
11
  *
9
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12
- * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14
- * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15
- * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
12
+ * The above copyright notice and this permission notice shall be included in
13
+ * all copies or substantial portions of the Software.
14
+ *
15
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ * THE SOFTWARE.
16
22
  */
17
23
 
18
24
  #ifndef BUFFER_H__
@@ -80,4 +86,3 @@ void bufprintf(struct buf *, const char *, ...) __attribute__ ((format (printf,
80
86
  #endif
81
87
 
82
88
  #endif
83
-