ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/extfs.cpp
(Generate patch)

Comparing BasiliskII/src/extfs.cpp (file contents):
Revision 1.33 by asvitkine, 2007-01-24T02:37:06Z vs.
Revision 1.35 by gbeauche, 2008-01-01T09:40:31Z

# Line 1 | Line 1
1   /*
2   *  extfs.cpp - MacOS file system for native file system access
3   *
4 < *  Basilisk II (C) 1997-2005 Christian Bauer
4 > *  Basilisk II (C) 1997-2008 Christian Bauer
5   *
6   *  This program is free software; you can redistribute it and/or modify
7   *  it under the terms of the GNU General Public License as published by
# Line 158 | Line 158 | struct FSItem {
158          uint32 id;                              // CNID of this file/dir
159          uint32 parent_id;               // CNID of parent file/dir
160          FSItem *parent;                 // Pointer to parent
161 <        char name[32];                  // Object name (C string) - Host OS
162 <        char guest_name[32];                    // Object name (C string) - Guest OS
161 >        char *name;                             // Object name (C string) - Host OS
162 >        char guest_name[32];    // Object name (C string) - Guest OS
163          time_t mtime;                   // Modification time for get_cat_info caching
164          int cache_dircount;             // Cached number of files in directory
165   };
# Line 235 | Line 235 | static FSItem *create_fsitem(const char
235          p->id = next_cnid++;
236          p->parent_id = parent->id;
237          p->parent = parent;
238 <        strncpy(p->name, name, 31);
239 <        p->name[31] = 0;
238 >        p->name = new char[strlen(name) + 1];
239 >        strcpy(p->name, name);
240          strncpy(p->guest_name, guest_name, 31);
241          p->guest_name[31] = 0;
242          p->mtime = 0;
# Line 416 | Line 416 | void ExtFSInit(void)
416          p->id = ROOT_PARENT_ID;
417          p->parent_id = 0;
418          p->parent = NULL;
419 +        p->name = new char[1];
420          p->name[0] = 0;
421          p->guest_name[0] = 0;
422  
# Line 427 | Line 428 | void ExtFSInit(void)
428          p->id = ROOT_ID;
429          p->parent_id = ROOT_PARENT_ID;
430          p->parent = first_fs_item;
431 <        strncpy(p->name, GetString(STR_EXTFS_VOLUME_NAME), 32);
432 <        p->name[31] = 0;
431 >        const char *volume_name = GetString(STR_EXTFS_VOLUME_NAME);
432 >        p->name = new char[strlen(volume_name) + 1];
433 >        strcpy(p->name, volume_name);
434          strncpy(p->guest_name, host_encoding_to_macroman(p->name), 32);
435          p->guest_name[31] = 0;
436  
# Line 453 | Line 455 | void ExtFSExit(void)
455          FSItem *p = first_fs_item, *next;
456          while (p) {
457                  next = p->next;
458 +                delete[] p->name;
459                  delete p;
460                  p = next;
461          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines