--- rxvt-unicode/src/xdefaults.C 2004/03/22 15:15:04 1.19 +++ rxvt-unicode/src/xdefaults.C 2004/12/01 02:12:18 1.42 @@ -1,12 +1,12 @@ /*--------------------------------*-C-*---------------------------------* - * File: xdefaults.c + * File: xdefaults.C *----------------------------------------------------------------------* - * $Id: xdefaults.C,v 1.19 2004/03/22 15:15:04 pcg Exp $ * * All portions of code are copyright by their respective author/s. * Copyright (c) 1994 Robert Nation * - original version * Copyright (c) 1997,1998 mj olesen + * Copyright (c) 2003-2004 Marc Lehmann * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -30,7 +30,6 @@ #include "../config.h" /* NECESSARY */ #include "rxvt.h" /* NECESSARY */ #include "version.h" -#include "xdefaults.intpro" /* PROTOS for internal routines */ /* #define DEBUG_RESOURCES */ @@ -65,7 +64,7 @@ /* convenient macros */ #define optList_strlen(i) \ - (optList[i].flag ? 0 : (optList[i].arg ? STRLEN (optList[i].arg) : 1)) + (optList[i].flag ? 0 : (optList[i].arg ? strlen (optList[i].arg) : 1)) #define optList_isBool(i) \ (optList[i].flag & Opt_Boolean) #define optList_isReverse(i) \ @@ -85,39 +84,38 @@ optList[] = { STRG (Rs_display_name, NULL, "d", NULL, NULL), /* short form */ STRG (Rs_display_name, NULL, "display", "string", "X server to contact"), - STRG (Rs_term_name, "termName", "tn", "string", - "value of the TERM environment variable"), + STRG (Rs_term_name, "termName", "tn", "string", "value of the TERM environment variable"), STRG (Rs_geometry, NULL, "g", NULL, NULL), /* short form */ - STRG (Rs_geometry, "geometry", "geometry", "geometry", - "size (in characters) and position"), + STRG (Rs_geometry, "geometry", "geometry", "geometry", "size (in characters) and position"), SWCH ("C", Opt_console, "intercept console messages"), SWCH ("iconic", Opt_iconic, "start iconic"), SWCH ("ic", Opt_iconic, NULL), /* short form */ - BOOL (Rs_reverseVideo, "reverseVideo", "rv", Opt_reverseVideo, - "reverse video"), + BOOL (Rs_reverseVideo, "reverseVideo", "rv", Opt_reverseVideo, "reverse video"), BOOL (Rs_loginShell, "loginShell", "ls", Opt_loginShell, "login shell"), BOOL (Rs_jumpScroll, "jumpScroll", "j", Opt_jumpScroll, "jump scrolling"), + BOOL (Rs_pastableTabs, "pastableTabs", "ptab", Opt_pastableTabs, "tab characters are pastable"), #ifdef HAVE_SCROLLBARS BOOL (Rs_scrollBar, "scrollBar", "sb", Opt_scrollBar, "scrollbar"), - BOOL (Rs_scrollBar_right, "scrollBar_right", "sr", Opt_scrollBar_right, - "scrollbar right"), - BOOL (Rs_scrollBar_floating, "scrollBar_floating", "st", - Opt_scrollBar_floating, "scrollbar without a trough"), -#endif - BOOL (Rs_scrollTtyOutput, "scrollTtyOutput", NULL, Opt_scrollTtyOutput, - NULL), - BOOL (Rs_scrollTtyOutput, NULL, "si", Opt_Reverse | Opt_scrollTtyOutput, - "scroll-on-tty-output inhibit"), - BOOL (Rs_scrollTtyKeypress, "scrollTtyKeypress", "sk", Opt_scrollTtyKeypress, - "scroll-on-keypress"), - BOOL (Rs_scrollWithBuffer, "scrollWithBuffer", "sw", Opt_scrollWithBuffer, - "scroll-with-buffer"), + BOOL (Rs_scrollBar_right, "scrollBar_right", "sr", Opt_scrollBar_right, "scrollbar right"), + BOOL (Rs_scrollBar_floating, "scrollBar_floating", "st", Opt_scrollBar_floating, "scrollbar without a trough"), +#endif + BOOL (Rs_scrollTtyOutput, "scrollTtyOutput", NULL, Opt_scrollTtyOutput, NULL), + BOOL (Rs_scrollTtyOutput, NULL, "si", Opt_Reverse | Opt_scrollTtyOutput, "scroll-on-tty-output inhibit"), + BOOL (Rs_scrollTtyKeypress, "scrollTtyKeypress", "sk", Opt_scrollTtyKeypress, "scroll-on-keypress"), + BOOL (Rs_scrollWithBuffer, "scrollWithBuffer", "sw", Opt_scrollWithBuffer, "scroll-with-buffer"), #ifdef TRANSPARENT - BOOL (Rs_transparent, "inheritPixmap", "ip", Opt_transparent, - "inherit parent pixmap"), - BOOL (Rs_transparent_all, "inheritPixmapforce", "ipf", Opt_transparent_all, - "forcefully inherit root pixmap"), + BOOL (Rs_transparent, "inheritPixmap", "ip", Opt_transparent, "inherit parent pixmap"), + BOOL (Rs_transparent_all, "inheritPixmapforce", "ipf", Opt_transparent_all, "forcefully inherit root pixmap"), SWCH ("tr", Opt_transparent, NULL), +#if TINTING + STRG (Rs_color + Color_tint, "tintColor", "tint", "color", "tint color"), +#endif +#endif +#ifdef OFF_FOCUS_FADING + STRG (Rs_fade, "fading", "fade", "%", "make colors x% darker when rxvt-unicode is losing focus."), +#endif +#ifdef TINTING + STRG (Rs_shade, "shading", "sh", "%", "shade background by x% when tinting."), #endif BOOL (Rs_utmpInhibit, "utmpInhibit", "ut", Opt_utmpInhibit, "utmp inhibit"), #ifndef NO_BELL @@ -130,12 +128,11 @@ BOOL (Rs_meta8, "meta8", NULL, Opt_meta8, NULL), #endif #ifdef MOUSE_WHEEL - BOOL (Rs_mouseWheelScrollPage, "mouseWheelScrollPage", NULL, Opt_mouseWheelScrollPage, - NULL), + BOOL (Rs_mouseWheelScrollPage, "mouseWheelScrollPage", NULL, Opt_mouseWheelScrollPage, NULL), #endif -#ifndef NO_FRILLS - BOOL (Rs_tripleclickwords, "tripleclickwords", "tcw", Opt_tripleclickwords, - "triple click word selection"), +#if ENABLE_FRILLS + BOOL (Rs_tripleclickwords, "tripleclickwords", "tcw", Opt_tripleclickwords, "triple click word selection"), + BOOL (Rs_insecure, "insecure", "insecure", Opt_insecure, "enable possibly insecure escape sequences"), #endif #ifdef CURSOR_BLINK BOOL (Rs_cursorBlink, "cursorBlink", "bc", Opt_cursorBlink, "blinking cursor"), @@ -165,6 +162,7 @@ #endif /* NO_BRIGHTCOLOR */ #ifndef NO_BOLD_UNDERLINE_REVERSE RSTRG (Rs_color + Color_BD, "colorBD", "color"), + RSTRG (Rs_color + Color_IT, "colorIT", "color"), RSTRG (Rs_color + Color_UL, "colorUL", "color"), RSTRG (Rs_color + Color_RV, "colorRV", "color"), #endif /* ! NO_BOLD_UNDERLINE_REVERSE */ @@ -179,24 +177,26 @@ RSTRG (Rs_path, "path", "search path"), #endif /* defined (XPM_BACKGROUND) || (MENUBAR_MAX) */ #ifdef XPM_BACKGROUND - STRG (Rs_backgroundPixmap, "backgroundPixmap", "pixmap", "file[;geom]", - "background pixmap"), + STRG (Rs_backgroundPixmap, "backgroundPixmap", "pixmap", "file[;geom]", "background pixmap"), #endif /* XPM_BACKGROUND */ #if (MENUBAR_MAX) RSTRG (Rs_menu, "menu", "name[;tag]"), #endif - STRG (Rs_font, "font", "fn", "fontname", "normal text font"), /* fonts: command-line option = resource name */ + STRG (Rs_font, "font", "fn", "fontname", "normal text font"), +#if ENABLE_STYLES + STRG (Rs_boldFont, "boldFont", "fb", "fontname", "bold font"), + STRG (Rs_italicFont, "italicFont", "fi", "fontname", "italic font"), + STRG (Rs_boldItalicFont, "boldItalicFont", "fbi", "fontname", "bold italic font"), +#endif #ifdef USE_XIM STRG (Rs_inputMethod, "inputMethod", "im", "name", "name of input method"), - STRG (Rs_preeditType, "preeditType", "pt", "style", - "input style: style = OverTheSpot|OffTheSpot|Root"), + STRG (Rs_preeditType, "preeditType", "pt", "style", "input style: style = OverTheSpot|OffTheSpot|Root"), #if defined(HAVE_XSETLOCALE) || defined(HAVE_SETLOCALE) STRG (Rs_imLocale, "imLocale", "imlocale", "string", "locale to use for input method"), #endif #endif /* USE_XIM */ - STRG (Rs_name, NULL, "name", "string", - "client instance, icon, and title strings"), + STRG (Rs_name, NULL, "name", "string", "client instance, icon, and title strings"), STRG (Rs_title, "title", "title", "string", "title name for window"), STRG (Rs_title, NULL, "T", NULL, NULL), /* short form */ STRG (Rs_iconName, "iconName", "n", "string", "icon name for window"), @@ -205,26 +205,21 @@ /* command-line option = resource name */ RSTRG (Rs_color + Color_cursor2, "cursorColor2", "color"), #endif /* NO_CURSORCOLOR */ - STRG (Rs_color + Color_pointer, "pointerColor", "pr", "color", - "pointer color"), - STRG (Rs_color + Color_border, "borderColor", "bd", "color", - "border color"), - STRG (Rs_saveLines, "saveLines", "sl", "number", - "number of scrolled lines to save"), -#ifndef NO_FRILLS - STRG (Rs_ext_bwidth, "externalBorder", "w", "number", - "external border in pixels"), + STRG (Rs_color + Color_pointer_fg, "pointerColor", "pr", "color", "pointer color"), + STRG (Rs_color + Color_pointer_bg, "pointerColor2", "pr2", "color", "pointer bg color"), + STRG (Rs_color + Color_border, "borderColor", "bd", "color", "border color"), + STRG (Rs_saveLines, "saveLines", "sl", "number", "number of scrolled lines to save"), +#if ENABLE_FRILLS + STRG (Rs_ext_bwidth, "externalBorder", "w", "number", "external border in pixels"), STRG (Rs_ext_bwidth, NULL, "bw", NULL, NULL), STRG (Rs_ext_bwidth, NULL, "borderwidth", NULL, NULL), - STRG (Rs_int_bwidth, "internalBorder", "b", "number", - "internal border in pixels"), + STRG (Rs_int_bwidth, "internalBorder", "b", "number", "internal border in pixels"), + BOOL (Rs_borderLess, "borderLess", "bl", Opt_borderLess, "borderless window"), #endif #ifndef NO_LINESPACE - STRG (Rs_lineSpace, "lineSpace", "lsp", "number", - "number of extra pixels between rows"), + STRG (Rs_lineSpace, "lineSpace", "lsp", "number", "number of extra pixels between rows"), #endif - STRG (Rs_scrollBar_thickness, "thickness", "sbt", "number", - "scrollbar thickness/width in pixels"), + STRG (Rs_scrollBar_thickness, "thickness", "sbt", "number", "scrollbar thickness/width in pixels"), #ifdef POINTER_BLANK RSTRG (Rs_pointerBlankDelay, "pointerBlankDelay", "number"), #endif @@ -242,13 +237,16 @@ #ifdef PRINTPIPE RSTRG (Rs_print_pipe, "print-pipe", "string"), #endif - STRG (Rs_modifier, "modifier", "mod", "modifier", - "meta modifier = alt|meta|hyper|super|mod1|...|mod5"), + STRG (Rs_modifier, "modifier", "mod", "modifier", "meta modifier = alt|meta|hyper|super|mod1|...|mod5"), INFO ("xrm", "string", "X resource"), #ifdef CUTCHAR_RESOURCE RSTRG (Rs_cutchars, "cutchars", "string"), #endif /* CUTCHAR_RESOURCE */ RSTRG (Rs_answerbackstring, "answerbackString", "string"), +#ifndef NO_SECONDARY_SCREEN + BOOL (Rs_secondaryScreen, "secondaryScreen", "ssc", Opt_secondaryScreen, "enable secondary screen"), + BOOL (Rs_secondaryScroll, "secondaryScroll", "ssr", Opt_secondaryScroll, "enable secondary screen scroll"), +#endif INFO ("e", "command arg ...", "command to execute") }; @@ -259,29 +257,61 @@ #undef BOOL /*}}} */ -static const char releasestring[] = "Rxvt v" VERSION " - released: " DATE "\n"; -static const char optionsstring[] = "Options: " +static const char releasestring[] = "rxvt-unicode (" RXVTNAME ") v" VERSION " - released: " DATE "\n"; +static const char optionsstring[] = "options: " +#if XFT + "xft," +#endif +#if ENABLE_STYLES + "styles," +#endif +#if ENABLE_COMBINING + "combining," +#endif +#if TEXT_BLINK + "blink," +#endif +#if ISO_14755 + "iso14755," +#endif +#if UNICODE_3 + "unicode3," +#endif + "encodings=eu+vn" +#if ENCODING_JP + "+jp" +#endif +#if ENCODING_JP_EXT + "+jp-ext" +#endif +#if ENCODING_KR + "+kr" +#endif +#if ENCODING_ZH + "+zh" +#endif +#if ENCODING_ZH_EXT + "+zh-ext" +#endif + "," +#if OFF_FOCUS_FADING + "fade," +#endif #if defined(XPM_BACKGROUND) "XPM," #endif #if defined(TRANSPARENT) "transparent," #endif +#if TINTING + "tint," +#endif #if defined(UTMP_SUPPORT) "utmp," #endif #if defined(MENUBAR) "menubar," #endif -#if !defined(NO_FRILLS) - "frills," -#endif -#if !defined(NO_LINESPACE) - "linespace," -#endif -#if defined(PREFER_24BIT) - "24bit," -#endif #if defined(USE_XIM) "XIM," #endif @@ -318,11 +348,38 @@ #if defined(NO_DELETE_KEY) "no_delete," #endif +#if EIGHT_BIT_CONTROLS + "8bitctrls," +#endif #if !defined(NO_STRINGS) "strings," #endif -#if defined(TTY_256COLOR) - "256colour," +#if defined(ENABLE_FRILLS) + "frills," +#endif +#if !defined(NO_LINESPACE) + "linespace," +#endif +#if defined(PREFER_24BIT) + "24bit," +#endif +#if defined(SELECTION_SCROLLING) + "selectionscrolling," +#endif +#if MOUSE_WHEEL + "wheel," +#endif +#if MOUSE_SLIP_WHEELING + "slipwheel," +#endif +#if defined(SMART_RESIZE) + "smart-resize," +#endif +#if defined(CURSOR_BLINK) + "cursorBlink," +#endif +#if defined(POINTER_BLANK) + "pointerBlank," #endif #if defined(NO_RESOURCES) "NoResources" @@ -365,7 +422,7 @@ #ifdef DEBUG_STRICT assert (optList[i].opt != NULL); #endif - len += 4 + STRLEN (optList[i].opt) + (optList_isBool (i) ? 2: 0); + len += 4 + strlen (optList[i].opt) + (optList_isBool (i) ? 2: 0); col += len; if (col > 79) { /* assume regular width */ @@ -392,7 +449,7 @@ #endif rxvt_log (" %s%s %-*s%s%s\n", (optList_isBool (i) ? "-/+" : "-"), optList[i].opt, - (INDENT - STRLEN (optList[i].opt) + (INDENT - strlen (optList[i].opt) + (optList_isBool (i) ? 0 : 2)), (optList[i].arg ? optList[i].arg : ""), (optList_isBool (i) ? "turn on/off " : ""), @@ -409,7 +466,7 @@ if (optList[i].kw != NULL) rxvt_log (" %s: %*s%s\n", optList[i].kw, - (INDENT - STRLEN (optList[i].kw)), "", /* XXX */ + (INDENT - strlen (optList[i].kw)), "", /* XXX */ (optList_isBool (i) ? "boolean" : optList[i].arg)); #ifdef KEYSYM_RESOURCE rxvt_log (" " "keysym.sym" ": %*s%s\n", @@ -462,48 +519,34 @@ continue; } - if (!STRCMP (opt, "help")) + if (!strcmp (opt, "help")) rxvt_usage (longopt ? 2 : 1); - if (!STRCMP (opt, "h")) + if (!strcmp (opt, "h")) rxvt_usage (0); /* feature: always try to match long-options */ for (entry = 0; entry < optList_size (); entry++) - if ((optList[entry].kw && !STRCMP (opt, optList[entry].kw)) + if ((optList[entry].kw && !strcmp (opt, optList[entry].kw)) || (!longopt - && optList[entry].opt && !STRCMP (opt, optList[entry].opt))) + && optList[entry].opt && !strcmp (opt, optList[entry].opt))) break; if (entry < optList_size ()) { if (optList_isReverse (entry)) flag = flag == On ? Off : On; - if (optList_strlen (entry)) - { /* string value */ - const char *str = argv[++i]; -#ifdef DEBUG_RESOURCES - fprintf (stderr, "string (%s,%s) = ", - optList[entry].opt ? optList[entry].opt : "nil", - optList[entry].kw ? optList[entry].kw : "nil"); -#endif - if (flag == On && str && (optList[entry].doff != -1)) - { -#ifdef DEBUG_RESOURCES - fprintf (stderr, "\"%s\"\n", str); -#endif - rs[optList[entry].doff] = str; - /* - * special cases are handled in main.c:main () to allow - * X resources to set these values before we settle for - * default values - */ - } -#ifdef DEBUG_RESOURCES - else - fprintf (stderr, "???\n"); -#endif + if (optList_strlen (entry)) + { + /* + * special cases are handled in main.c:main () to allow + * X resources to set these values before we settle for + * default values + */ + if (optList[entry].doff != -1) + rs[optList[entry].doff] = flag == On && argv[i+1] + ? argv[++i] : 0; } else { /* boolean value */ @@ -512,9 +555,9 @@ optList[entry].opt, optList[entry].kw, flag); #endif if (flag == On) - Options |= (optList[entry].flag); + options |= (optList[entry].flag); else - Options &= ~ (optList[entry].flag); + options &= ~ (optList[entry].flag); if (optList[entry].doff != -1) rs[optList[entry].doff] = flag; @@ -522,7 +565,7 @@ } else #ifdef KEYSYM_RESOURCE - /* if (!STRNCMP (opt, "keysym.", sizeof ("keysym.") - 1)) */ + /* if (!strncmp (opt, "keysym.", sizeof ("keysym.") - 1)) */ if (rxvt_Str_match (opt, "keysym.")) { const char *str = argv[++i]; @@ -601,7 +644,7 @@ str += 2; if (arg) { - if (sscanf (str, (STRCHR (str, ':') ? "%x:" : "%x"), &sym) != 1) + if (sscanf (str, (strchr (str, ':') ? "%x:" : "%x"), &sym) != 1) return -1; } else @@ -610,7 +653,7 @@ return -1; /* cue to ':', it's there since sscanf () worked */ - STRNCPY (newargstr, STRCHR (str, ':') + 1, NEWARGLIM - 1); + strncpy (newargstr, strchr (str, ':') + 1, NEWARGLIM - 1); newargstr[NEWARGLIM - 1] = '\0'; newarg = newargstr; } @@ -620,11 +663,11 @@ /* * convert keysym name to keysym number */ - STRNCPY (newargstr, str, NEWARGLIM - 1); + strncpy (newargstr, str, NEWARGLIM - 1); newargstr[NEWARGLIM - 1] = '\0'; if (arg == NULL) { - if ((newarg = STRCHR (newargstr, ':')) == NULL) + if ((newarg = strchr (newargstr, ':')) == NULL) return -1; *newarg++ = '\0'; /* terminate keysym name */ } @@ -640,7 +683,7 @@ if (newarg == NULL) { - STRNCPY (newargstr, arg, NEWARGLIM - 1); + strncpy (newargstr, arg, NEWARGLIM - 1); newargstr[NEWARGLIM - 1] = '\0'; newarg = newargstr; } @@ -651,7 +694,7 @@ key_string = (char *)rxvt_malloc ((n + 1) * sizeof (char)); key_string[0] = n; - STRNCPY (key_string + 1, newarg, n); + strncpy (key_string + 1, newarg, n); Keysym_map[sym] = (unsigned char *)key_string; return 1; @@ -673,7 +716,7 @@ if (stream == NULL) return; - len = STRLEN (name); + len = strlen (name); while ((str = fgets (buffer, sizeof (buffer), stream)) != NULL) { unsigned int entry, n; @@ -682,7 +725,7 @@ str++; /* leading whitespace */ if ((str[len] != '*' && str[len] != '.') - || (len && STRNCMP (str, name, len))) + || (len && strncmp (str, name, len))) continue; str += (len + 1); /* skip `name*' or `name.' */ @@ -696,13 +739,13 @@ if (kw == NULL) continue; - n = STRLEN (kw); + n = strlen (kw); if (str[n] == ':' && rxvt_Str_match (str, kw)) { /* skip `keyword:' */ str += n + 1; rxvt_Str_trim (str); - n = STRLEN (str); + n = strlen (str); if (n && rs[optList[entry].doff] == NULL) { /* not already set */ @@ -712,7 +755,7 @@ for (int o = 0;;) { p = (char *)rxvt_realloc (p, o + n + 1); - MEMCPY (p + o, str, n); + memcpy (p + o, str, n); o += n; p[o] = 0; @@ -725,7 +768,7 @@ break; rxvt_Str_trim (str); - n = STRLEN (str); + n = strlen (str); } rs[optList[entry].doff] = p; @@ -733,18 +776,18 @@ if (optList_isBool (entry)) { - s = STRCASECMP (str, "TRUE") == 0 - || STRCASECMP (str, "YES") == 0 - || STRCASECMP (str, "ON") == 0 - || STRCASECMP (str, "1") == 0; + s = strcasecmp (str, "TRUE") == 0 + || strcasecmp (str, "YES") == 0 + || strcasecmp (str, "ON") == 0 + || strcasecmp (str, "1") == 0; if (optList_isReverse (entry)) s = !s; if (s) - Options |= optList[entry].flag; + options |= optList[entry].flag; else - Options &= ~optList[entry].flag; + options &= ~optList[entry].flag; } } @@ -813,14 +856,14 @@ # ifdef HAVE_EXTRA_XRESOURCE_FILES /* Add in ~/.Xdefaults or ~/.Xresources */ { - char *ptr; + char *ptr; if ((ptr = (char *)getenv ("HOME")) == NULL) ptr = "."; for (i = 0; i < (sizeof (xnames) / sizeof (xnames[0])); i++) { - sprintf (fname, "%-.*s/%s", sizeof (fname) - STRLEN (xnames[i]) - 2, + sprintf (fname, "%-.*s/%s", sizeof (fname) - strlen (xnames[i]) - 2, ptr, xnames[i]); if ((rdb1 = XrmGetFileDatabase (fname))) { @@ -875,11 +918,11 @@ p = XGetDefault (display, name, kw); p0 = XGetDefault (display, "!INVALIDPROGRAMMENAMEDONTMATCH!", kw); - if (p == NULL || (p0 && STRCMP (p, p0) == 0)) + if (p == NULL || (p0 && strcmp (p, p0) == 0)) { p = XGetDefault (display, RESCLASS, kw); #ifdef RESFALLBACK - if (p == NULL || (p0 && STRCMP (p, p0) == 0)) + if (p == NULL || (p0 && strcmp (p, p0) == 0)) p = XGetDefault (display, RESFALLBACK, kw); #endif } @@ -893,16 +936,16 @@ if (optList_isBool (entry)) { - s = STRCASECMP (p, "TRUE") == 0 - || STRCASECMP (p, "YES") == 0 - || STRCASECMP (p, "ON") == 0 - || STRCASECMP (p, "1") == 0; + s = strcasecmp (p, "TRUE") == 0 + || strcasecmp (p, "YES") == 0 + || strcasecmp (p, "ON") == 0 + || strcasecmp (p, "1") == 0; if (optList_isReverse (entry)) s = !s; if (s) - Options |= (optList[entry].flag); + options |= (optList[entry].flag); else - Options &= ~ (optList[entry].flag); + options &= ~ (optList[entry].flag); } } } @@ -940,12 +983,12 @@ if ((home = getenv ("HOME")) != NULL) { - unsigned int i, len = STRLEN (home) + 2; + unsigned int i, len = strlen (home) + 2; char *f = NULL; for (i = 0; i < (sizeof (xnames) / sizeof (xnames[0])); i++) { - f = (char *)rxvt_realloc (f, (len + STRLEN (xnames[i])) * sizeof (char)); + f = (char *)rxvt_realloc (f, (len + strlen (xnames[i])) * sizeof (char)); sprintf (f, "%s/%s", home, xnames[i]);