~clint-fewbar/ubuntu/precise/squid3/ignore-sighup-early

« back to all changes in this revision

Viewing changes to lib/uudecode.c

  • Committer: Bazaar Package Importer
  • Author(s): Luigi Gangitano
  • Date: 2009-09-24 14:51:06 UTC
  • mfrom: (1.1.12 upstream)
  • mto: (20.2.1 sid)
  • mto: This revision was merged to the branch mainline in revision 21.
  • Revision ID: james.westby@ubuntu.com-20090924145106-38jgrzmj0d73pha5
Tags: 3.1.0.13-1
* Upload to experimental

* New upstream release
  - Fixes Follow-X-Forwarded-For support (Closes: #523943)
  - Adds IPv6 support (Closes: #432351)

* debian/rules
  - Removed obsolete configuration options
  - Enable db and radius basic authentication modules

* debian/patches/01-cf.data.debian
  - Adapted to new upstream version

* debian/patches/02-makefile-defaults
  - Adapted to new upstream version

* debian/{squid.postinst,squid.rc,README.Debian,watch}
  - Updated references to squid 3.1

* debian/squid3.install
  - Install CSS file for error pages
  - Install manual pages for new authentication modules

* debian/squid3-common.install
  - Install documented version of configuration file in /usr/share/doc/squid3

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * $Id: uudecode.c,v 1.11 2004/08/30 05:12:30 robertc Exp $
 
2
 * $Id$
3
3
 */
4
4
 
5
5
#include "config.h"
8
8
extern char **environ;
9
9
 
10
10
/* aaaack but it's fast and const should make it shared text page. */
11
 
const int pr2six[256] =
12
 
{
 
11
const int pr2six[256] = {
13
12
    64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64,
14
13
    64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 64, 62, 64, 64, 64, 63,
15
14
    52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 64, 64, 64, 64, 64, 64, 64, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
35
34
    /* Strip leading whitespace. */
36
35
 
37
36
    while (*bufcoded == ' ' || *bufcoded == '\t')
38
 
        bufcoded++;
 
37
        bufcoded++;
39
38
 
40
39
    /* Figure out how many characters are in the input buffer.
41
40
     * Allocate this many from the per-transaction pool for the result.
50
49
    bufin = (const unsigned char *) bufcoded;
51
50
 
52
51
    while (nprbytes > 0) {
53
 
        *(bufout++) =
54
 
            (unsigned char) (pr2six[*bufin] << 2 | pr2six[bufin[1]] >> 4);
55
 
        *(bufout++) =
56
 
            (unsigned char) (pr2six[bufin[1]] << 4 | pr2six[bufin[2]] >> 2);
57
 
        *(bufout++) =
58
 
            (unsigned char) (pr2six[bufin[2]] << 6 | pr2six[bufin[3]]);
59
 
        bufin += 4;
60
 
        nprbytes -= 4;
 
52
        *(bufout++) =
 
53
            (unsigned char) (pr2six[*bufin] << 2 | pr2six[bufin[1]] >> 4);
 
54
        *(bufout++) =
 
55
            (unsigned char) (pr2six[bufin[1]] << 4 | pr2six[bufin[2]] >> 2);
 
56
        *(bufout++) =
 
57
            (unsigned char) (pr2six[bufin[2]] << 6 | pr2six[bufin[3]]);
 
58
        bufin += 4;
 
59
        nprbytes -= 4;
61
60
    }
62
61
 
63
62
    if (nprbytes & 03) {
64
 
        if (pr2six[bufin[-2]] > 63)
65
 
            nbytesdecoded -= 2;
66
 
        else
67
 
            nbytesdecoded -= 1;
 
63
        if (pr2six[bufin[-2]] > 63)
 
64
            nbytesdecoded -= 2;
 
65
        else
 
66
            nbytesdecoded -= 1;
68
67
    }
69
68
    bufplain[nbytesdecoded] = '\0';
70
69
    return bufplain;