~pythonregexp2.7/python/issue2636-11

« back to all changes in this revision

Viewing changes to Modules/mmapmodule.c

  • Committer: Jeffrey C. "The TimeHorse" Jacobs
  • Date: 2008-09-21 13:47:31 UTC
  • mfrom: (39021.1.404 Regexp-2.7)
  • mto: This revision was merged to the branch mainline in revision 39030.
  • Revision ID: darklord@timehorse.com-20080921134731-rudomuzeh1b2tz1y
Merged in changes from the latest python source snapshot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
239
239
                return(NULL);
240
240
 
241
241
        /* silently 'adjust' out-of-range requests */
242
 
        if ((self->pos + num_bytes) > self->size) {
 
242
        if (num_bytes > self->size - self->pos) {
243
243
                num_bytes -= (self->pos+num_bytes) - self->size;
244
244
        }
245
245
        result = Py_BuildValue("s#", self->data+self->pos, num_bytes);
992
992
will be the current size of the file when mmap is called.\n\
993
993
flags specifies the nature of the mapping. MAP_PRIVATE creates a\n\
994
994
private copy-on-write mapping, so changes to the contents of the mmap\n\
995
 
object will be private to this process, and MAP_SHARED`creates a mapping\n\
 
995
object will be private to this process, and MAP_SHARED creates a mapping\n\
996
996
that's shared with all other processes mapping the same areas of the file.\n\
997
997
The default value is MAP_SHARED.\n\
998
998
\n\