Changeset 3380 for trunk/packages/vizservers/pymolproxy/pymolproxy2.c
- Timestamp:
- Feb 27, 2013 11:48:35 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/packages/vizservers/pymolproxy/pymolproxy2.c
r3379 r3380 548 548 549 549 #define STATSDIR "/var/tmp/visservers" 550 551 static int552 SplitPath(const char *path, int *argcPtr, char ***argvPtr)553 {554 char **array;555 int count;556 char *p;557 char *s;558 size_t addrsize;559 560 count = 0;561 for (p = strchr((char *)path, '/'); p != NULL; p = strchr(p+1, '/')) {562 count++;563 }564 addrsize = (count + 1) * sizeof(char *);565 array = (char **)malloc(addrsize + strlen(path) + 1);566 s = (char *)array + addrsize;567 strcpy(s, path);568 569 count = 0;570 for (p = strtok(s, "/"); p != NULL; p = strtok(NULL, "/")) {571 array[count++] = p;572 }573 *argcPtr = count;574 *argvPtr = array;575 return count;576 }577 550 578 551 static int
Note: See TracChangeset
for help on using the changeset viewer.