Changeset 3848 for trunk/tools/database


Ignore:
Timestamp:
Jul 18, 2000, 7:56:51 PM (25 years ago)
Author:
bird
Message:

Added and updated authors.
Corrected dep rule in makefile
Corrections and improvements in stateupd.

Location:
trunk/tools/database
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/database/Authors.sql

    r3838 r3848  
    1 -- $Id: Authors.sql,v 1.3 2000-07-18 07:15:56 bird Exp $
     1-- $Id: Authors.sql,v 1.4 2000-07-18 17:56:49 bird Exp $
    22--
    33-- Insert authors.
     
    99DELETE FROM author;
    1010--                         refcode name               initials alias        email                           country              city/location
     11--                                                             (cvs user)
    1112INSERT INTO author VALUES ( 1, 'Sander van Leeuwen',    'SvL', 'sandervl', 'sandervl@xs4all.nl',            'the Netherlands',   'Delft');
    1213INSERT INTO author VALUES ( 2, 'Peter Fitzsimmons',     'PF',  NULL,       'pfitzsim@home.com',             'Canada',            'Mississauga, Ontario');
    13 INSERT INTO author VALUES ( 3, 'Patrick Haller',        'PT',  'phaller',  'haller@zebra.fh-weingarten.de', 'Germany',           NULL);
    14 INSERT INTO author VALUES ( 4, 'Joel Troster',          'JT',  NULL,      'jtroster@atitech.ca',           'Canada',            'Thornhill, Ontario');
    15 INSERT INTO author VALUES ( 5, 'Vince Vielhaber',       'VV',  NULL,       'vev@michvhf.com',               'USA',               'Oxford, MI');
     14INSERT INTO author VALUES ( 3, 'Patrick Haller',        'PT',  'phaller',  'phaller@gmx.net',              'Germany',           NULL);
     15INSERT INTO author VALUES ( 4, 'Joel Troster',          'JT',  'jtroster', 'jtroster@atitech.ca',           'Canada',            'Thornhill, Ontario');
     16INSERT INTO author VALUES ( 5, 'Vince Vielhaber',       'VV',  'vince',    'vev@michvhf.com',               'USA',               'Oxford, MI');
    1617INSERT INTO author VALUES ( 6, 'Chris McKillop',        'CMK', NULL,       'cdmckill@engmail.uwaterloo.ca', 'Canada',            'Waterloo, Ontario');
    1718INSERT INTO author VALUES ( 7, 'Felix Maschek',         'FM',  NULL,       'felix@maschek.com',             'Germany',           'Ammersbek');
     
    1920INSERT INTO author VALUES ( 8, 'Mark Stead',            'MS',  NULL,       'mar-@unico.com.au',             NULL,                NULL);
    2021INSERT INTO author VALUES ( 9, 'Henk Kelder',           'HK',  NULL,       'henk.kelde-@capgemini.nl',      NULL,                NULL);
    21 INSERT INTO author VALUES (10, 'Daniela Engert',        'DE',  NULL,       'd.enger-@odn.de',               NULL,                NULL);
     22INSERT INTO author VALUES (10, 'Daniela Engert',        'DE',  'dengert',  'dani@ngrt.de',                  NULL,                NULL);
    2223INSERT INTO author VALUES (11, 'Jens B„ckman',          'JB',  NULL,       'os2war-@hem.passagen.se',       NULL,                NULL);
    2324INSERT INTO author VALUES (12, 'Ed Ng',                 'EG',  NULL,       'en-@hubcap.clemson.edu',        NULL,                NULL);
    2425INSERT INTO author VALUES (13, 'Ken Ames',              'KA',  NULL,       'kename-@eathlink.net',          NULL,                NULL);
    2526INSERT INTO author VALUES (14, 'Craig Bradney',         'CrB', NULL,       'cbradne-@zip.com.au',           NULL,                NULL);
    26 INSERT INTO author VALUES (15, 'Achim Hasenmueller',    'AH',  NULL,       'achimh-@innotek.de',            NULL,                NULL);
     27INSERT INTO author VALUES (15, 'Achim Hasenmueller',    'AH',  'achimha',  'achimha@innotek.de',            NULL,                NULL);
    2728INSERT INTO author VALUES (16, 'Rene Pronk',            'RPr', NULL,       'r.pron-@twi.tudelft.nl',        NULL,                NULL);
    28 INSERT INTO author VALUES (17, 'Christoph Bratschi',    'ChB', NULL,       'cbratsch-@datacomm.ch',         NULL,                NULL);
    29 INSERT INTO author VALUES (18, 'Przemyslaw Dobrowolski','PD',  NULL,       'dobrawk-@asua.org.pl',          NULL,                NULL);
     29INSERT INTO author VALUES (17, 'Christoph Bratschi',    'ChB', 'cbratschi','cbratsch-@datacomm.ch',         NULL,                NULL);
     30INSERT INTO author VALUES (18, 'Przemyslaw Dobrowolski','PD',  NULL,       'dobrawka@asua.org.pl',          NULL,                NULL);
    3031INSERT INTO author VALUES (19, 'Bartosz Tomasik',       'BT',  NULL,       'bart-@asua.org.pl',             NULL,                NULL);
    3132INSERT INTO author VALUES (20, 'Radu Trimbitas',        'RT',  NULL,       'rad-@rds.ro',                   NULL,                NULL);
    3233INSERT INTO author VALUES (21, 'Erast V. Kunenkov',     'ER',  NULL,       'eras-@tips-gw.ips.ac.ru',       NULL,                NULL);
    33 INSERT INTO author VALUES (22, 'Ulrich Muller',         'UM',  NULL,       'ulrich.moelle-@rz.hu-berlin.de', NULL,               NULL);
     34INSERT INTO author VALUES (22, 'Ulrich Muller',         'UM',  NULL,       'ulrich.moelle-@rz.hu-berlin.de',NULL,               NULL);
    3435INSERT INTO author VALUES (23, 'Joachim Schneider',     'JS',  NULL,       'joaschneide-@debitel.net',      NULL,                NULL);
    35 INSERT INTO author VALUES (24, 'David Raison',          'DR',  NULL,       'dj-@lemur.co.uk',               NULL,                NULL);
     36INSERT INTO author VALUES (24, 'David Raison',          'DR',  'davidr',   'djr@lemur.co.uk',               NULL,                NULL);
    3637INSERT INTO author VALUES (25, 'Robert Pouliot',        'RPo', NULL,       'kryno-@clic.net',               NULL,                NULL);
    37 INSERT INTO author VALUES (26, 'Markus Montkowski',     'MM',  NULL,       'mmontkowsk-@norman.de',         NULL,                NULL);
     38INSERT INTO author VALUES (26, 'Markus Montkowski',     'MM',  NULL,       'mmontkowski@gmx.de',            NULL,                NULL);
    3839INSERT INTO author VALUES (27, 'Marty ??',              'M??', NULL,       'mart-@rochester.rr.com',        NULL,                NULL);
    3940INSERT INTO author VALUES (28, 'Josef Chmel',           'JCh', NULL,       'chme-@mujweb.cz',               NULL,                NULL);
    4041INSERT INTO author VALUES (29, 'Lee Riemenschneider',   'LR',  NULL,       'lwrieme-@wcic.cioe.com',        NULL,                NULL);
    4142INSERT INTO author VALUES (30, 'Jeppe Cramon',          'JCr', NULL,       'jepp-@cramon.dk',               NULL,                NULL);
    42 INSERT INTO author VALUES (31, 'Edgar Buerkle',         'EB',  NULL,       NULL,                            NULL,                NULL);
    43 INSERT INTO author VALUES (32, 'Yuri Dario',            'UD',  NULL,       NULL,                            NULL,                NULL);
     43INSERT INTO author VALUES (31, 'Edgar Buerkle',         'EB',  'buerkle',  'Edgar.Buerkle@gmx.net',         NULL,                NULL);
     44INSERT INTO author VALUES (32, 'Yuri Dario',            'UD',  NULL,       'mc6530@mclink.it',              NULL,                NULL);
    4445INSERT INTO author VALUES (33, 'Adrian Gschwend',       'AG',  NULL,       NULL,                            NULL,                NULL);
    45 INSERT INTO author VALUES (34, 'Jeroen van den Horn',   'JvH', NULL,       NULL,                            NULL,                NULL);
     46-- correct cvs user?
     47INSERT INTO author VALUES (34, 'Jeroen van den Horn',   'JvH', 'hugh',     'J.vandenHorn@fibre.a2000.nl',   NULL,                NULL);
    4648INSERT INTO author VALUES (35, 'Bart van Leeuwen',      'BvL', NULL,       NULL,                            NULL,                NULL);
    4749INSERT INTO author VALUES (36, 'Nenad Milenkovic',      'NM',  NULL,       NULL,                            NULL,                NULL);
    48 INSERT INTO author VALUES (37, 'Michal Necasek',        'MN',  NULL,       NULL,                            NULL,                NULL);
    49 INSERT INTO author VALUES (38, 'Vitali E. Pelenyov',    'VEP', NULL,       NULL,                            NULL,                NULL);
     50INSERT INTO author VALUES (37, 'Michal Necasek',        'MN', 'mike',      'mike@mendelu.cz',               NULL,                NULL);
     51INSERT INTO author VALUES (38, 'Vitali E. Pelenyov',    'VEP', NULL,       'tvv@sbs.kiev.ua',               NULL,                NULL);
    5052INSERT INTO author VALUES (39, 'Vit Timchishin',        'VT',  NULL,       NULL,                            NULL,                NULL);
    51 INSERT INTO author VALUES (40, 'Jens Wiessner',         'JW',  NULL,       NULL,                            NULL,                NULL);
    52 INSERT INTO author VALUES (4095,'knut st. osmundsen',   'kso', 'bird',     'knut.stange.osmundsen@pmsc.no', 'Norway',            'Oslo');
     53INSERT INTO author VALUES (40, 'Jens Wiessner',         'JW',  'jens',     'wiessnej@rfi.de',               NULL,                NULL);
     54INSERT INTO author VALUES (41, 'Christian Langanke',    'CL',  'cla',      'cbratschi@datacomm.ch',         NULL,                NULL);
     55INSERT INTO author VALUES (4095,'knut st. osmundsen',   'kso', 'bird',     'knut.stange.osmundsen@mynd.no', 'Norway',            'Oslo');
    5356
    5457
  • trunk/tools/database/Makefile

    r3841 r3848  
    1 # $Id: Makefile,v 1.12 2000-07-18 07:35:52 bird Exp $
     1# $Id: Makefile,v 1.13 2000-07-18 17:56:51 bird Exp $
    22
    33#
     
    111111#
    112112dep:
    113     $(DEPEND) $(CINCLUDES) *.h *.asm *.inc $(PDWIN32_INCLUDE)\*.h \
     113    $(DEPEND) $(CINCLUDES) -o- *.h *.asm *.inc $(PDWIN32_INCLUDE)\*.h \
    114114        *.c *.cpp -objo *.c *.cpp
    115115    cd gd
  • trunk/tools/database/StateUpd.cpp

    r3840 r3848  
    1 /* $Id: StateUpd.cpp,v 1.24 2000-07-18 07:33:13 bird Exp $
     1/* $Id: StateUpd.cpp,v 1.25 2000-07-18 17:56:50 bird Exp $
    22 *
    33 * StateUpd - Scans source files for API functions and imports data on them.
     
    6868static void  copy(char *psz, char *pszFrom, int iFrom, char *pszTo, int iTo, char **papszLines);
    6969static void  copy(char *psz, int jFrom, int iFrom, int jTo, int iTo, char **papszLines);
    70 static void  copyComment(char *psz, char *pszFrom, int iFrom, char **papszLines, BOOL fStrip);
    71 static void  copyComment(char *psz, int jFrom, int iFrom, char **papszLines, BOOL fStrip);
     70static void  copyComment(char *psz, char *pszFrom, int iFrom, char **papszLines, BOOL fStrip, BOOL fHTML);
     71static void  copyComment(char *psz, int jFrom, int iFrom, char **papszLines, BOOL fStrip, BOOL fHTML);
    7272static char *stristr(const char *pszStr, const char *pszSubStr);
    7373static char *skipBackwards(const char *pszStopAt, const char *pszFrom, int &iLine, char **papszLines);
     
    9494    char          *pszUser     = "root";
    9595    char          *pszPasswd   = "";
    96     ULONG          ul0, ul1, ul2;
     96    ULONG          ul1, ul2;
     97    ULONG          cUpdated, cAll, cNotAliased;
    9798
    9899    DosError(0x3);
     
    317318        if (!options.fIntegrityOnly)
    318319        {
    319             ul2 = dbGetNumberOfUpdatedFunction(options.lDllRefcode);
    320             ul1 = dbCountFunctionInDll(options.lDllRefcode, FALSE);
    321             ul0 = dbCountFunctionInDll(options.lDllRefcode, TRUE);
    322             if (ul0 > ul2)
    323             {
    324                 fprintf(phSignal, "%d functions where not found (found=%d, total=%d).\n", ul0 - ul2, ul2, ul0);
     320            cUpdated    = dbGetNumberOfUpdatedFunction(options.lDllRefcode);
     321            cAll        = dbCountFunctionInDll(options.lDllRefcode, FALSE);
     322            cNotAliased = dbCountFunctionInDll(options.lDllRefcode, TRUE);
     323            if (cNotAliased > cUpdated)
     324            {
     325                fprintf(phSignal, "%d functions where not found (found=%d, total=%d).\n",
     326                        cNotAliased- cUpdated, cUpdated, cNotAliased);
    325327                ulRc += 0x00010000;
    326328            }
     
    330332            fprintf(phLog, "-------------------------------------------------\n");
    331333            fprintf(phLog, "-------------------------------------------------\n\n");
    332             fprintf(phLog,"Number of function in this DLL:        %4ld (%ld)\n", ul1, ul0);
    333             fprintf(phLog,"Number of successfully processed APIs: %4ld (%ld)\n", (long)(0x0000FFFF & ulRc), ul2);
     334            fprintf(phLog,"Number of function in this DLL:        %4ld (%ld)\n", cAll, cNotAliased);
     335            fprintf(phLog,"Number of successfully processed APIs: %4ld (%ld)\n", (long)(0x0000FFFF & ulRc), cUpdated);
    334336        }
    335337        fprintf(phLog,"Number of signals:                     %4ld\n", (long)(ulRc >> 16));
     
    344346        if (!options.fIntegrityOnly)
    345347        {
    346             fprintf(stdout,"Number of function in this DLL:        %4ld (%ld)\n", ul1, ul0);
    347             fprintf(stdout,"Number of successfully processed APIs: %4ld (%ld)\n", (long)(0x0000FFFF & ulRc), ul2);
     348            fprintf(stdout,"Number of function in this DLL:        %4ld (%ld)\n", cAll, cNotAliased);
     349            fprintf(stdout,"Number of successfully processed APIs: %4ld (%ld)\n", (long)(0x0000FFFF & ulRc), cUpdated);
    348350        }
    349351        fprintf(stdout,"Number of signals:                     %4ld\n", (long)(ulRc >> 16));
     
    657659    char *  psz, *psz2;
    658660    const char *    pszDBFilename;
    659     char *          pszLastDateTime;
    660     char *          pszRevision;
    661     char *          pszAuthor;
    662     signed long     lLastAuthor;
     661    char *          pszLastDateTime = NULL;
     662    char *          pszRevision     = NULL;
     663    char *          pszAuthor       = NULL;
     664    signed long     lLastAuthor     = 0;
     665    unsigned long   ulRc            = 0;
    663666
    664667    /*
     
    689692    {   /* found $Id: */
    690693        psz2 = strchr(psz+3, '$');
    691         strncpy(&szId[0], psz, psz2 - psz);
    692         szId[psz2 - psz] = '\0';
    693         iRet = i;
    694 
    695         /* parse it! */
    696         psz = strstr(szId+4, ",v ");
    697         if (psz == NULL)
    698         {
    699             fprintf(phSignal, "%s, module header: $Id keyword is incorrect (or the parsing code is broken).\n", pszFilename);
    700             return 0x00010000;
    701         }
    702         pszRevision = trim(psz + 3);
    703         psz = strchr(pszRevision, ' ');
    704         *psz++ = '\0';
    705         trimR(pszRevision);
    706 
    707         pszLastDateTime = trim(psz);
    708         psz = strchr(strchr(pszLastDateTime, ' ') + 1, ' ');
    709         *psz++ = '\0';
    710         pszLastDateTime[4] = pszLastDateTime[7] = '-';
    711         trimR(pszLastDateTime);
    712 
    713         pszAuthor = trim(psz);
    714         psz = strchr(pszAuthor, ' ');
    715         *psz = '\0';
    716         lLastAuthor = dbFindAuthor(pszAuthor, NULL);
    717 
    718         /*
    719          * Is there more stuff here, in this comment?
    720          * Skip to end of the current comment and copy the contents to szDescription.
    721          * if szDescription suddenly contains nothing.
    722          */
    723         psz = &szDescription[0];
    724         copyComment(psz, psz2+1, i, papszLines, TRUE);
    725         while (*psz == '\n' && *psz == ' ')
    726             psz++;
    727         if (*psz == '\0')
    728         {   /*
    729              * No description in the first comment. (The one with $Id.)
    730              * Is there a comment following the first one?
     694        if (psz2 != NULL && psz2 - psz > 39 && psz2 - psz < 256)
     695        {
     696            strncpy(&szId[0], psz, psz2 - psz);
     697            szId[psz2 - psz] = '\0';
     698            iRet = i;
     699   
     700            /* parse it! */
     701            psz = strstr(szId+4, ",v ");
     702            if (psz != NULL)
     703            {
     704                pszRevision = trim(psz + 3);
     705                psz = strchr(pszRevision, ' ');
     706                *psz++ = '\0';
     707                trimR(pszRevision);
     708
     709                pszLastDateTime = trim(psz);
     710                psz = strchr(strchr(pszLastDateTime, ' ') + 1, ' ');
     711                *psz++ = '\0';
     712                pszLastDateTime[4] = pszLastDateTime[7] = '-';
     713                trimR(pszLastDateTime);
     714
     715                pszAuthor = trim(psz);
     716                psz = strchr(pszAuthor, ' ');
     717                *psz = '\0';
     718                lLastAuthor = dbFindAuthor(pszAuthor, NULL);
     719            }
     720            else
     721            {
     722                fprintf(phSignal, "%s, module header: $Id keyword is incorrect (2).\n", pszFilename);
     723                ulRc += 0x00010000;
     724            }
     725
     726
     727            /*
     728             * Is there more stuff here, in this comment?
     729             * Skip to end of the current comment and copy the contents to szDescription.
     730             * if szDescription suddenly contains nothing.
    731731             */
    732             while (papszLines[i] != NULL && strstr(papszLines[i++], "*/") == NULL)
    733                 i = i;
    734             while (papszLines[i] != NULL)
    735             {
    736                 psz2 = papszLines[i];
    737                 while (*psz2 == ' ')
    738                     psz2++;
    739                 if (*psz2 != '\0')
    740                     break;
    741                 i++;
    742             }
    743             if (psz2 != NULL && strncmp(psz2, "/*", 2) == 0)
    744             {
    745                 psz = &szDescription[0];
    746                 copyComment(psz, psz2+1, i, papszLines, TRUE);
    747                 while (*psz == '\n' && *psz == ' ')
    748                     psz++;
    749                 if (psz == '\0')
    750                     szDescription[0] = '\0';
    751 
     732            psz = &szDescription[0];
     733            copyComment(psz, psz2+1, i, papszLines, TRUE, TRUE);
     734            if (*psz == '\0')
     735            {   /*
     736                 * No description in the first comment. (The one with $Id.)
     737                 * Is there a comment following the first one?
     738                 */
     739                while (papszLines[i] != NULL && strstr(papszLines[i++], "*/") == NULL)
     740                    i = i;
     741                while (papszLines[i] != NULL)
     742                {
     743                    psz2 = papszLines[i];
     744                    while (*psz2 == ' ')
     745                        psz2++;
     746                    if (*psz2 != '\0')
     747                        break;
     748                    i++;
     749                }
     750                if (psz2 != NULL && strncmp(psz2, "/*", 2) == 0)
     751                {
     752                    psz = &szDescription[0];
     753                    copyComment(psz, psz2+1, i, papszLines, TRUE, TRUE);
     754                    while (*psz == '\n' && *psz == ' ')
     755                        psz++;
     756                    if (psz == '\0')
     757                        szDescription[0] = '\0';
     758
     759                    /* Skip to line after comment end. */
     760                    while (papszLines[i] != NULL && strstr(papszLines[i++], "*/") == NULL)
     761                        i = i;
     762                }
     763            }
     764            else
     765            {
    752766                /* Skip to line after comment end. */
    753767                while (papszLines[i] != NULL && strstr(papszLines[i++], "*/") == NULL)
     
    757771        else
    758772        {
    759             /* Skip to line after comment end. */
    760             while (papszLines[i] != NULL && strstr(papszLines[i++], "*/") == NULL)
    761                 i = i;
     773            fprintf(phSignal, "%s, module header: $Id keyword is incorrect (1).\n", pszFilename);
     774            ulRc += 0x00010000;
    762775        }
    763776        iRet = i;
     777
    764778
    765779        /*
     
    774788             */
    775789            pOptions->lFileRefcode = dbFindFile(pOptions->lDllRefcode, pszDBFilename);
    776             if (pOptions->lFileRefcode <= 0)
     790            if (pOptions->lFileRefcode < 0)
    777791            {
    778792                fprintf(phSignal, "%s, module header: failed to find file in DB. %s\n",
     
    836850        }
    837851        else
    838             copyComment(&szBuffer[0], 0, i+1, papszLines, TRUE);
     852            copyComment(&szBuffer[0], 0, i+1, papszLines, TRUE, TRUE);
    839853
    840854        /* Update database */
     
    15641578                /* find parameter */
    15651579                for (j = 0; j < pFnDesc->cParams; j++)
    1566                     if (strcmp(pFnDesc->apszParamName[j], pszParam) != 0)
     1580                    if (strcmp(pFnDesc->apszParamName[j], pszParam) == 0)
    15671581                        break;
    15681582                if (j < pFnDesc->cParams)
     
    25322546 *
    25332547 */
    2534 static void copyComment(char *psz, char *pszFrom, int iFrom, char **papszLines, BOOL fStrip)
    2535 {
    2536     copyComment(psz, pszFrom - papszLines[iFrom], iFrom, papszLines, fStrip);
     2548static void copyComment(char *psz, char *pszFrom, int iFrom, char **papszLines, BOOL fStrip, BOOL fHTML)
     2549{
     2550    copyComment(psz, pszFrom - papszLines[iFrom], iFrom, papszLines, fStrip, fHTML);
    25372551}
    25382552
     
    25492563 * @param       papszLines  Array of lines.
    25502564 * @param       fStrip      Strip blank lines at start and end + LICENCE notice (at end).
     2565 * @param       fHTML       Convert to HTML while copying.
    25512566 * @status      completely implemented.
    25522567 * @author      knut st. osmundsen (knut.stange.osmundsen@mynd.no)
    25532568 */
    2554 static void copyComment(char *psz, int jFrom, int iFrom, char **papszLines, BOOL fStrip)
     2569static void copyComment(char *psz, int jFrom, int iFrom, char **papszLines, BOOL fStrip, BOOL fHTML)
    25552570{
    25562571    char *  pszStartBuffer = psz;       /* Start of the target buffer. */
     
    25872602                psz = pszStart;
    25882603            if (psz > pszStartBuffer || !fStrip)
     2604            {
     2605                if (fHTML)
     2606                {
     2607                    *psz++ = '<';
     2608                    *psz++ = 'B';
     2609                    *psz++ = 'R';
     2610                    *psz++ = '>';
     2611                }
    25892612                *psz++ = '\n';
     2613            }
    25902614
    25912615            /* next */
     
    26032627    if (fStrip)
    26042628    {
     2629        if (fHTML)
     2630        {
     2631            while (psz >= pszStartBuffer)
     2632            {
     2633                if (*psz == ' ' || *psz == '\n' || *psz == '\0')
     2634                    *psz-- = '\0';
     2635                else if (psz - 4 >= pszStartBuffer && strncmp(psz - 4, "<BR>", 4) == 0)
     2636                    *(psz -= 4) = '\0';
     2637                else
     2638                    break;
     2639            }
     2640        }
    26052641        while (psz >= pszStartBuffer && (*psz == ' ' || *psz == '\n' || *psz == '\0'))
    26062642            *psz-- = '\0';
    26072643
     2644
    26082645        if (psz - 20 > pszStartBuffer && strstr(psz - 20, "LICENSE.TXT") != NULL)
    26092646        {
     
    26122649        }
    26132650
     2651        if (fHTML)
     2652        {
     2653            while (psz >= pszStartBuffer)
     2654            {
     2655                if (*psz == ' ' || *psz == '\n' || *psz == '\0')
     2656                    *psz-- = '\0';
     2657                else if (psz - 4 >= pszStartBuffer && strncmp(psz - 4, "<BR>", 4) == 0)
     2658                    *(psz -= 4) = '\0';
     2659                else
     2660                    break;
     2661            }
     2662        }
    26142663        while (psz >= pszStartBuffer && (*psz == ' ' || *psz == '\n' || *psz == '\0'))
    26152664            *psz-- = '\0';
  • trunk/tools/database/db.cpp

    r3841 r3848  
    1 /* $Id: db.cpp,v 1.14 2000-07-18 07:34:32 bird Exp $ *
     1/* $Id: db.cpp,v 1.15 2000-07-18 17:56:50 bird Exp $ *
    22 *
    33 * DB - contains all database routines.
     
    396396
    397397        parow = mysql_fetch_row(pres);
    398         if (parow != NULL)
    399             lFile = getvalue(0, parow);
     398        assert(parow);
     399        lFile = getvalue(0, parow);
    400400        mysql_free_result(pres);
    401401
     
    19291929static char *sqlstrcat(char *pszQuery, const char *pszBefore, const char *pszStr, const char *pszAfter)
    19301930{
    1931     register char ch;
     1931    char *          pszLineStart = pszQuery;   
     1932    register char   ch;
    19321933
    19331934    pszQuery += strlen(pszQuery);
     
    19481949    while ((ch = *pszStr++) != '\0')
    19491950    {
    1950         if (ch == '\'')
    1951         {
    1952             *pszQuery++ = '\\';
    1953             *pszQuery++ = '\'';
    1954         }
    1955         else if (ch == '\n')
    1956         {
    1957             #if 0
    1958             *pszQuery++ = '\\';
    1959             *pszQuery++ = 'n';
    1960             #else
    1961             *pszQuery++ = '<';
    1962             *pszQuery++ = 'B';
    1963             *pszQuery++ = 'R';
    1964             *pszQuery++ = '>';
    1965             #endif
    1966         }
    1967         else if (ch == '\r')
    1968         {
    1969             #if 0
    1970             *pszQuery++ = '\\';
    1971             *pszQuery++ = 'r';
    1972             #else
    1973             *pszQuery++ = '<';
    1974             *pszQuery++ = 'B';
    1975             *pszQuery++ = 'R';
    1976             *pszQuery++ = '>';
    1977             #endif
    1978         }
    1979         else
    1980             *pszQuery++ = ch;
     1951        switch (ch)
     1952        {
     1953            case '\'':
     1954                *pszQuery++ = '\\';
     1955                *pszQuery++ = '\'';
     1956                break;
     1957
     1958            case '"':
     1959                *pszQuery++ = '\\';
     1960                *pszQuery++ = '"';
     1961                break;
     1962
     1963            case '\\':
     1964                *pszQuery++ = '\\';
     1965                *pszQuery++ = '\\';
     1966                break;
     1967
     1968            case '%':
     1969                *pszQuery++ = '\\';
     1970                *pszQuery++ = '%';
     1971                break;
     1972
     1973            case '_':
     1974                *pszQuery++ = '\\';
     1975                *pszQuery++ = '_';
     1976                break;
     1977
     1978            case '\n':
     1979                *pszQuery++ = '\\';
     1980                *pszQuery++ = 'r';
     1981                *pszQuery++ = '\\';
     1982                *pszQuery++ = 'n';
     1983                break;
     1984           
     1985            case '\t':
     1986                *pszQuery++ = '\\';
     1987                *pszQuery++ = 't';
     1988                break;
     1989
     1990            case '\r':
     1991                break;
     1992
     1993            default:
     1994                *pszQuery++ = ch;
     1995        }
     1996
     1997        /* Add new lines every 80 chars MySql don't like long lines. */
     1998        if (pszLineStart - pszQuery > 80)
     1999        {
     2000            *pszQuery = '\n';
     2001            pszLineStart = pszQuery;
     2002        }
    19812003    }
    19822004    *pszQuery++ = '\'';
Note: See TracChangeset for help on using the changeset viewer.