IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 18, 2007, 9:37:31 AM (19 years ago)
Author:
rhl
Message:

strcasestr isn't in posix (and is in C namespace). Use psStrcasestr

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/psLib/src/db/psDB.c

    r12552 r12885  
    1212 *  @author Joshua Hoblitt
    1313 *
    14  *  @version $Revision: 1.141 $ $Name: not supported by cvs2svn $
    15  *  @date $Date: 2007-03-22 22:48:34 $
     14 *  @version $Revision: 1.142 $ $Name: not supported by cvs2svn $
     15 *  @date $Date: 2007-04-18 19:37:31 $
    1616 *
    1717 *  Copyright (C) 2005-2006  Joshua Hoblitt, University of Hawaii
     
    15301530        }
    15311531
    1532         if (strcasestr(item->comment, "AUTO_INCREMENT")) {
     1532        if (psStrcasestr(item->comment, "AUTO_INCREMENT")) {
    15331533            psStringAppend(&query, " %s", "AUTO_INCREMENT");
    15341534        }
    1535         if (strcasestr(item->comment, "Unique")) {
     1535        if (psStrcasestr(item->comment, "Unique")) {
    15361536            psStringAppend(&query, " %s", "UNIQUE");
    15371537        }
    1538         if (strcasestr(item->comment, "NOT NULL")) {
     1538        if (psStrcasestr(item->comment, "NOT NULL")) {
    15391539            psStringAppend(&query, " %s", "NOT NULL");
    15401540        }
     
    15541554    psArray *pKeys = psArrayAllocEmpty(1);
    15551555    while ((item = psListGetAndIncrement(cursor))) {
    1556         if (strcasestr(item->comment, "Primary Key")) {
     1556        if (psStrcasestr(item->comment, "Primary Key")) {
    15571557            psArrayAdd(pKeys, 0, item->name);
    15581558        }
     
    15761576    while ((item = psListGetAndIncrement(cursor))) {
    15771577        // it's just a regular key if it matchs "Key" but not "Primary Key"
    1578         if (strcasestr(item->comment, "Key")
    1579                 && (strcasestr(item->comment, "Primary Key") == NULL)) {
     1578        if (psStrcasestr(item->comment, "Key")
     1579                && (psStrcasestr(item->comment, "Primary Key") == NULL)) {
    15801580            psStringAppend(&query, ", KEY(%s)", item->name);
    1581         } else if (strcasestr(item->comment, "AUTO_INCREMENT")) {
     1581        } else if (psStrcasestr(item->comment, "AUTO_INCREMENT")) {
    15821582            // this needs to be recognized as a key if it wasn't already
    15831583            psStringAppend(&query, ", KEY(%s)", item->name);
     
    15901590    while ((item = psListGetAndIncrement(cursor))) {
    15911591        // don't compile a regex unless we have too
    1592         if (strcasestr(item->comment, "FKEY") == NULL) {
     1592        if (psStrcasestr(item->comment, "FKEY") == NULL) {
    15931593            continue;
    15941594        }
     
    18721872            psMetadataItem *mItem = NULL;
    18731873            while ((mItem = psListGetAndIncrement(mCursor))) {
    1874                 if (mItem->comment && strcasestr(mItem->comment, "==")) {
     1874                if (mItem->comment && psStrcasestr(mItem->comment, "==")) {
    18751875                    logicalOp = "OR";
    18761876                    break;
     
    20962096            psStringAppend(&query, "%s IS NULL", itemName);
    20972097        } else {
    2098             if (item->comment && strcasestr(item->comment, "LIKE")) {
     2098            if (item->comment && psStrcasestr(item->comment, "LIKE")) {
    20992099                // XXX ASC NOTE: we should have a better match for
    21002100                // char & varchar columns than this.  LIKE is OK for
Note: See TracChangeset for help on using the changeset viewer.