Skip to content

Commit 5f417db

Browse files
src/base64.tcl: preserve also the copyright notice from the original tcllib base64.tcl file [#9]
1 parent 8b9b1e9 commit 5f417db

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

Makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,15 @@ all: check-cli
55
build: seguid
66

77
src/base64.tcl:
8+
@url=https://core.tcl-lang.org/tcllib/raw/f6bea09d4aa9768279d2b74f7ab4a114dfb7c0583beded9da44eda66e888b8f7?at=base64.tcl; \
9+
tf=base64.tcl; \
10+
curl --silent "$${url}" > "$${tf}"; \
811
{ \
9-
url=https://core.tcl-lang.org/tcllib/raw/f6bea09d4aa9768279d2b74f7ab4a114dfb7c0583beded9da44eda66e888b8f7?at=base64.tcl; \
10-
echo "## The following code was extracted from the tcllib source code"; \
12+
echo "## The following Base64 encode code was extracted from the tcllib source code"; \
1113
echo "## $${url}"; \
1214
echo ; \
13-
curl --silent "$${url}" | sed -n -e '/namespace eval base64 {/,$$p' | sed -e '/# ::base64::decode --/,$$d' | sed 's/ decode//'; \
15+
head -n 19 "$${tf}"; \
16+
sed -n -e '/namespace eval base64 {/,$$p' "$${tf}" | sed -e '/# ::base64::decode --/,$$d' | sed 's/ decode//'; \
1417
} >> "$@"
1518

1619
seguid: src/seguid.tcl src/base64.tcl src/sha1.tcl

src/base64.tcl

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,25 @@
1-
## The following code was extracted from the tcllib source code
1+
## The following Base64 encode code was extracted from the tcllib source code
22
## https://core.tcl-lang.org/tcllib/raw/f6bea09d4aa9768279d2b74f7ab4a114dfb7c0583beded9da44eda66e888b8f7?at=base64.tcl
33

4+
# base64.tcl --
5+
#
6+
# Encode/Decode base64 for a string
7+
# Stephen Uhler / Brent Welch (c) 1997 Sun Microsystems
8+
# The decoder was done for exmh by Chris Garrigues
9+
#
10+
# Copyright (c) 1998-2000 by Ajuba Solutions.
11+
# See the file "license.terms" for information on usage and redistribution
12+
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
13+
14+
# Version 1.0 implemented Base64_Encode, Base64_Decode
15+
# Version 2.0 uses the base64 namespace
16+
# Version 2.1 fixes various decode bugs and adds options to encode
17+
# Version 2.2 is much faster, Tcl8.0 compatible
18+
# Version 2.2.1 bugfixes
19+
# Version 2.2.2 bugfixes
20+
# Version 2.3 bugfixes and extended to support Trf
21+
# Version 2.4.x bugfixes
22+
423
namespace eval base64 {
524
variable base64 {}
625
variable base64_en {}

0 commit comments

Comments
 (0)