Changeset 716
- Timestamp:
- 03/11/07 20:20:21 (2 years ago)
- Files:
-
- 1.8.2/trunk/CHANGES.182 (modified) (1 diff)
- 1.8.2/trunk/Patchlevel (modified) (1 diff)
- 1.8.2/trunk/game/txt/hlp/penncmd.hlp (modified) (1 diff)
- 1.8.2/trunk/game/txt/hlp/pennv182.hlp (modified) (3 diffs)
- 1.8.2/trunk/hdrs/version.h (modified) (1 diff)
- 1.8.2/trunk/src/attrib.c (modified) (1 diff)
- 1.8.2/trunk/src/bsd.c (modified) (2 diffs)
- 1.8.2/trunk/src/command.c (modified) (1 diff)
- 1.8.2/trunk/src/cque.c (modified) (3 diffs)
- 1.8.2/trunk/src/filecopy.c (modified) (1 diff)
- 1.8.2/trunk/src/funlist.c (modified) (10 diffs)
- 1.8.2/trunk/src/funmisc.c (modified) (2 diffs)
- 1.8.2/trunk/src/funstr.c (modified) (2 diffs)
- 1.8.2/trunk/src/rob.c (modified) (2 diffs)
- 1.8.2/trunk/src/utils.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
1.8.2/trunk/CHANGES.182
r651 r716 14 14 15 15 ========================================================================== 16 17 Version 1.8.2 patchlevel 3 March 11, 2007 18 19 Fixes: 20 * Unterminated buffer in sortkey() fixed. Reported by Balerion. 21 Patch by Javelin. 22 * Memory leaks in setunion() and revwords() fixed by Javelin. 23 * Crash bug in speak() fixed. Reported by Trinsec. Patch by Javelin. 24 * Crash bug in buy fixed. Reported by Amy. Patch by Javelin. 25 * If we should fail to clear a semaphore attribute for some 26 reason (e.g., it's the branch of an attribute tree), reset 27 the semaphore count on the attribute to 0. Patch by Javelin. 28 * iter() dealt badly with freeing buffers when CPU_LIMIT or 29 function_invocation_limit was hit. Found by Ashen-Shugar. [GM] 30 * @ps/all displayed the wrong queue entry count for mortals. 31 Reported by Cheetah. [SW] 32 * @hook/override of say would get an extra leading " if that was 33 used instead of the literal say command. Reported by Tuxedo Ian. 34 [SW] 35 * Fixed a bug where speech seemed to come from the wrong 36 object for nospoof information. Reported by Jules. [SW] 37 * The help entry for @poll failed to mention @poll/clear. 38 Reported by Cooee. [SW] 16 39 17 40 Version 1.8.2 patchlevel 2 January 27, 2007 1.8.2/trunk/Patchlevel
r651 r716 1 1 Do not edit this file. It is maintained by the official PennMUSH patches. 2 This is PennMUSH 1.8.2p 22 This is PennMUSH 1.8.2p3 1.8.2/trunk/game/txt/hlp/penncmd.hlp
r651 r716 2693 2693 See also @emit, @oemit, @remit, NOSPOOF, and SPOOFING. 2694 2694 & @poll 2695 @poll 2695 2696 @poll <poll question> 2696 This wizard-only command sets the "poll" - the Doing question. If 2697 "@poll" is used by itself, the question is reset to the default 2698 string "Doing". It can also be used by those with the poll @power. 2697 @poll/clear 2698 2699 This command manipulate the message at the top of WHO/DOING. By itself, 2700 it displays the current poll. Wizards and those with the poll @power can 2701 set or clear the message. 2699 2702 2700 2703 See also: @doing, WHO, DOING 1.8.2/trunk/game/txt/hlp/pennv182.hlp
r651 r716 1 & 1.8.2p 21 & 1.8.2p3 2 2 & changes 3 3 This is a list of changes in this patchlevel which are probably of … … 12 12 be read in 'help patchlevels'. 13 13 14 Version 1.8.2 patchlevel 3 March 11, 2007 15 16 Fixes: 17 * Unterminated buffer in sortkey() fixed. Reported by Balerion. 18 Patch by Javelin. 19 * Memory leaks in setunion() and revwords() fixed by Javelin. 20 * Crash bug in speak() fixed. Reported by Trinsec. Patch by Javelin. 21 * Crash bug in buy fixed. Reported by Amy. Patch by Javelin. 22 * If we should fail to clear a semaphore attribute for some 23 reason (e.g., it's the branch of an attribute tree), reset 24 the semaphore count on the attribute to 0. Patch by Javelin. 25 * iter() dealt badly with freeing buffers when CPU_LIMIT or 26 function_invocation_limit was hit. Found by Ashen-Shugar. [GM] 27 * @ps/all displayed the wrong queue entry count for mortals. 28 Reported by Cheetah. [SW] 29 * @hook/override of say would get an extra leading " if that was 30 used instead of the literal say command. Reported by Tuxedo Ian. 31 [SW] 32 * Fixed a bug where speech seemed to come from the wrong 33 object for nospoof information. Reported by Jules. [SW] 34 * The help entry for @poll failed to mention @poll/clear. 35 Reported by Cooee. [SW] 36 37 & 1.8.2p2 14 38 Version 1.8.2 patchlevel 2 January 27, 2007 15 39 … … 31 55 * Fixed the distribution of random numbers with a huge range. Reported 32 56 by Luke. 57 33 58 & 1.8.2p1 34 59 Version 1.8.2 patchlevel 1 November 26, 2006 1.8.2/trunk/hdrs/version.h
r651 r716 1 1 #define VERSION "1.8.2" 2 #define PATCHLEVEL " 2"3 #define PATCHDATE "[0 1/27/2007]"4 #define NUMVERSION 100800200 22 #define PATCHLEVEL "3" 3 #define PATCHDATE "[03/11/2007]" 4 #define NUMVERSION 1008002003 1.8.2/trunk/src/attrib.c
r531 r716 462 462 num_new++; 463 463 } 464 /* Only GOD can create an AF_NODUMP attribute (used for semaphores) 465 * or add a leaf to a tree with such an attribute 466 */ 467 if ((AL_FLAGS(atr) & AF_NODUMP) && (player != GOD)) { 468 missing_name[0] = '\0'; 469 return AE_ERROR; 470 } 464 471 if (Cannot_Write_This_Attr(player, atr, 1)) { 465 472 missing_name[0] = '\0'; 1.8.2/trunk/src/bsd.c
r557 r716 3787 3787 int start, count; 3788 3788 int powered = (*(called_as + 1) != 'M'); 3789 int objid = ( index(called_as, 'D') != NULL);3789 int objid = (strchr(called_as, 'D') != NULL); 3790 3790 3791 3791 if (!is_strict_integer(args[0]) || !is_strict_integer(args[1])) { … … 3845 3845 dbref victim; 3846 3846 int powered = ((*called_as == 'L') && Priv_Who(executor)); 3847 int objid = ( index(called_as, 'D') != NULL);3847 int objid = (strchr(called_as, 'D') != NULL); 3848 3848 3849 3849 first = 1; 1.8.2/trunk/src/command.c
r566 r716 913 913 case SAY_TOKEN: 914 914 replacer = "SAY"; 915 #if 0 916 /* Messes up hooks when chat_strip_quote is yes. See bug #6677 */ 915 917 if (CHAT_STRIP_QUOTE) 916 918 p--; /* Since 'say' strips out the '"' */ 919 #endif 917 920 break; 918 921 case POSE_TOKEN: 1.8.2/trunk/src/cque.c
r566 r716 124 124 num = parse_integer(atr_value(a)); 125 125 num += am; 126 if (num) { 127 sprintf(buff, "%d", num); 128 (void) atr_add(player, name, buff, GOD, flags); 129 } else { 126 /* We set the attribute's value to 0 even if we're going to clear 127 * it later, because clearing it may fail (perhaps someone's also 128 * foolishly using it as a branch in an attribute tree) 129 */ 130 sprintf(buff, "%d", num); 131 (void) atr_add(player, name, buff, GOD, flags); 132 if (!num) { 130 133 (void) atr_clr(player, name, GOD); 131 134 } … … 904 907 (*del)++; 905 908 else if (q_all || (Owner(tmp->player) == victim)) { 906 (*self)++; 907 if (!q_quiet && (LookQueue(player) 908 || Owns(tmp->player, player))) { 909 if ((LookQueue(player) 910 || Owns(tmp->player, player))) { 911 (*self)++; 912 if (q_quiet) 913 continue; 909 914 switch (q_type) { 910 915 case 1: /* wait queue */ 911 notify_format(player, "[%ld]%s: %s", tmp->left - mudtime,916 notify_format(player, "[%ld]%s: %s", tmp->left - mudtime, 912 917 unparse_object(player, tmp->player), tmp->comm); 913 918 break; 914 919 case 2: /* semaphore queue */ 915 920 if (tmp->left != 0) { 916 notify_format(player, "[#%d/%s/%ld]%s: %s", tmp->sem,921 notify_format(player, "[#%d/%s/%ld]%s: %s", tmp->sem, 917 922 tmp->semattr, tmp->left - mudtime, 918 923 unparse_object(player, tmp->player), tmp->comm); 919 924 } else { 920 notify_format(player, "[#%d/%s]%s: %s", tmp->sem,925 notify_format(player, "[#%d/%s]%s: %s", tmp->sem, 921 926 tmp->semattr, unparse_object(player, tmp->player), 922 927 tmp->comm); … … 924 929 break; 925 930 default: /* player or object queue */ 926 notify_format(player, "%s: %s", unparse_object(player,927 tmp->player),931 notify_format(player, "%s: %s", unparse_object(player, 932 tmp->player), 928 933 tmp->comm); 929 934 } 1.8.2/trunk/src/filecopy.c
r515 r716 207 207 char FileName[256]; 208 208 if (GetModuleFileName(NULL, FileName, 256) != 0) { 209 if (!strcasecmp( rindex(FileName, '\\') + 1, "pennmush.exe")) {209 if (!strcasecmp(strrchr(FileName, '\\') + 1, "pennmush.exe")) { 210 210 if (CopyFile("pennmush.exe", "pennmush_run.exe", FALSE)) { 211 211 do_rawlog(LT_ERR, "Successfully copied executable, starting copy."); 1.8.2/trunk/src/funlist.c
r651 r716 1212 1212 char outsep[BUFFER_LEN]; 1213 1213 int i; 1214 char tbuff[BUFFER_LEN];1215 char *tp;1216 char const *cp;1217 1214 char result[BUFFER_LEN]; 1218 char *rp; 1219 ATTR *attrib; 1220 dbref thing; 1215 ufun_attrib ufun; 1216 char *wenv[1]; 1221 1217 1222 1218 /* sortkey(attr,list,sort_type,delim,osep) */ … … 1234 1230 strcpy(outsep, args[4]); 1235 1231 1236 /* Find object and attribute to get sortby function from. */ 1237 parse_anon_attrib(executor, args[0], &thing, &attrib); 1238 if (!GoodObject(thing) || !attrib || !Can_Read_Attr(executor, thing, attrib)) { 1239 free_anon_attrib(attrib); 1240 return; 1241 } 1242 if (!CanEvalAttr(executor, thing, attrib)) { 1243 free_anon_attrib(attrib); 1244 return; 1245 } 1246 tp = tbuff; 1247 safe_str(atr_value(attrib), tbuff, &tp); 1248 *tp = '\0'; 1249 1232 /* find our object and attribute */ 1233 if (!fetch_ufun_attrib(args[0], executor, &ufun, 1)) 1234 return; 1250 1235 1251 1236 nptrs = list2arr_ansi(ptrs, MAX_SORTSIZE, args[1], sep); … … 1253 1238 /* Now we make a list of keys */ 1254 1239 for (i = 0; i < nptrs; i++) { 1255 global_eval_context.wenv[0] = (char *) ptrs[i]; 1256 rp = result; 1257 cp = tbuff; 1258 process_expression(result, &rp, &cp, 1259 thing, executor, enactor, 1260 PE_DEFAULT, PT_DEFAULT, pe_info); 1261 *rp = '\0'; 1240 /* Build our %0 args */ 1241 wenv[0] = (char *)ptrs[i]; 1242 call_ufun(&ufun, wenv, 2, result, executor, enactor, pe_info); 1262 1243 keys[i] = mush_strdup(result, "sortkey"); 1263 1244 } … … 1462 1443 char sep; 1463 1444 char **a1, **a2; 1464 int n1, n2, x1, x2, val ;1445 int n1, n2, x1, x2, val, orign1, orign2; 1465 1446 int lastx1, lastx2, found; 1466 1447 char *sort_type = ALPHANUM_LIST; … … 1481 1462 1482 1463 /* make arrays out of the lists */ 1483 n1 = list2arr_ansi(a1, MAX_SORTSIZE, args[0], sep);1484 n2 = list2arr_ansi(a2, MAX_SORTSIZE, args[1], sep);1464 orign1 = n1 = list2arr_ansi(a1, MAX_SORTSIZE, args[0], sep); 1465 orign2 = n2 = list2arr_ansi(a2, MAX_SORTSIZE, args[1], sep); 1485 1466 1486 1467 if (nargs < 4) { … … 1590 1571 } 1591 1572 } 1592 freearr(a1, n1);1593 freearr(a2, n2);1573 freearr(a1, orign1); 1574 freearr(a2, orign2); 1594 1575 mush_free((Malloc_t) a1, "ptrarray"); 1595 1576 mush_free((Malloc_t) a2, "ptrarray"); … … 2586 2567 { 2587 2568 char **words; 2588 int count ;2569 int count, origcount; 2589 2570 char sep; 2590 2571 char *osep, osepd[2] = { '\0', '\0' }; … … 2602 2583 words = (char **) mush_malloc(sizeof(char *) * BUFFER_LEN, "wordlist"); 2603 2584 2604 count = list2arr_ansi(words, BUFFER_LEN, args[0], sep);2585 origcount = count = list2arr_ansi(words, BUFFER_LEN, args[0], sep); 2605 2586 if (count == 0) { 2606 2587 mush_free((Malloc_t) words, "wordlist"); … … 2613 2594 safe_str(words[--count], buff, bp); 2614 2595 } 2615 freearr(words, count);2596 freearr(words, origcount); 2616 2597 mush_free((Malloc_t) words, "wordlist"); 2617 2598 } … … 2747 2728 sp = tbuf2; 2748 2729 if (process_expression(buff, bp, &sp, executor, caller, enactor, 2749 PE_DEFAULT, PT_DEFAULT, pe_info)) 2730 PE_DEFAULT, PT_DEFAULT, pe_info)) { 2731 mush_free((Malloc_t) tbuf2, "replace_string.buff"); 2750 2732 break; 2751 if (*bp == (buff + BUFFER_LEN - 1) && pe_info->fun_invocations == funccount) 2733 } 2734 if (*bp == (buff + BUFFER_LEN - 1) && pe_info->fun_invocations == funccount) { 2735 mush_free((Malloc_t) tbuf2, "replace_string.buff"); 2752 2736 break; 2737 } 2753 2738 funccount = pe_info->fun_invocations; 2754 2739 oldbp = *bp; 1.8.2/trunk/src/funmisc.c
r521 r716 69 69 int ns = string_prefix(called_as, "NS"); 70 70 int flags = PEMIT_LIST; 71 dbref saved_orator = orator; 71 72 if (!command_check_byname(executor, ns ? "@nspemit" : "@pemit") || 72 73 fun->flags & FN_NOSIDEFX) { … … 78 79 flags |= PEMIT_SPOOF; 79 80 do_pemit_list(executor, args[0], args[1], flags); 81 orator = saved_orator; 80 82 } 81 83 1.8.2/trunk/src/funstr.c
r651 r716 2248 2248 safe_format(buff, bp, "%s %s %s", Name(speaker), say_string, rbuff); 2249 2249 return; 2250 } else {2250 } else if (null == 1) { 2251 2251 wenv[0] = speaker_str; 2252 2252 wenv[1] = unparse_integer(fragment); … … 2298 2298 break; 2299 2299 funccount = pe_info->fun_invocations; 2300 if ( strlen(rbuff) == 0) {2300 if ((null == 1) && (strlen(rbuff) == 0)) { 2301 2301 wenv[0] = speaker_str; 2302 2302 wenv[1] = unparse_integer(fragment); 1.8.2/trunk/src/rob.c
r477 r716 159 159 { 160 160 dbref vendor; 161 char *prices;161 char prices[BUFFER_LEN]; 162 162 char *plus; 163 163 char *cost; … … 227 227 if (!a) 228 228 continue; 229 /* atr_value uses a static buffer, so we'll take advantage of that */230 prices = atr_value(a);229 strncpy(prices,atr_value(a),BUFFER_LEN); 230 prices[BUFFER_LEN-1] = '\0'; 231 231 upcasestr(prices); 232 count = list2arr(r, BUFFER_LEN / 2, atr_value(a), ' ');232 count = list2arr(r, BUFFER_LEN / 2, prices, ' '); 233 233 if (!count) 234 234 continue; 1.8.2/trunk/src/utils.c
r651 r716 147 147 AL_NEXT(*attrib) = NULL; 148 148 *thing = player; 149 return;150 149 } 150 return; 151 151 } 152 152 parse_attrib(player, str, thing, attrib);
