--- parser3/src/main/pa_string.C 2001/03/10 11:03:49 1.34 +++ parser3/src/main/pa_string.C 2001/03/11 10:54:39 1.38 @@ -1,5 +1,9 @@ /* - $Id: pa_string.C,v 1.34 2001/03/10 11:03:49 paf Exp $ + Parser + Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com) + Author: Alexander Petrosyan (http://design.ru/paf) + + $Id: pa_string.C,v 1.38 2001/03/11 10:54:39 paf Exp $ */ #include @@ -143,7 +147,7 @@ String& String::append(const String& src return *this; } void String::set_lang(Chunk::Row *row, Untaint_lang lang, size_t size) { - if(lang==APPENDED) + if(lang==PASS_APPENDED) return; while(size--) { @@ -166,7 +170,7 @@ String& String::real_append(STRING_APPEN append_here->item.ptr=src; fsize+=append_here->item.size=size; - append_here->item.lang=tainted?/*Untaint_lang::*/YES:Untaint_lang::NO; + append_here->item.lang=tainted?YES:NO; #ifndef NO_STRING_ORIGIN append_here->item.origin.file=file; append_here->item.origin.line=line; @@ -176,28 +180,6 @@ String& String::real_append(STRING_APPEN return *this; } -char *String::cstr() const { - char *result=static_cast(malloc(size()+1)); - - char *copy_here=result; - const Chunk *chunk=&head; - do { - const Chunk::Row *row=chunk->rows; - for(int i=0; icount; i++) { - if(row==append_here) - goto break2; - - memcpy(copy_here, row->item.ptr, row->item.size); - copy_here+=row->item.size; - row++; - } - chunk=row->link; - } while(chunk); -break2: - *copy_here=0; - return result; -} - uint String::hash_code() const { uint result=0;