From 150b8f9bffd6b0ff1a12749e4a99785c20528745 Mon Sep 17 00:00:00 2001 From: dholland Date: Sun, 1 May 2016 19:26:34 +0000 Subject: Patch up broad misuse of functions. Also patch some other things found by the compiler, like broken printf formats. Not complete, but a start. --- wm/afterstep/distinfo | 18 +- wm/afterstep/patches/patch-libAfterBase_output.c | 18 ++ wm/afterstep/patches/patch-libAfterBase_parse.c | 295 ++++++++++++++++++++- wm/afterstep/patches/patch-libAfterConf_Color.c | 43 +++ .../patches/patch-libAfterConf_DesktopEntry.c | 50 ++++ wm/afterstep/patches/patch-libAfterImage_import.c | 82 +++++- wm/afterstep/patches/patch-libAfterStep_asapp.c | 33 +++ wm/afterstep/patches/patch-libAfterStep_font.c | 22 ++ wm/afterstep/patches/patch-libAfterStep_freestor.c | 98 +++++++ .../patches/patch-libAfterStep_functions.c | 95 ++++++- wm/afterstep/patches/patch-libAfterStep_hints.c | 42 +++ wm/afterstep/patches/patch-libAfterStep_kde.c | 23 ++ wm/afterstep/patches/patch-libAfterStep_parser.c | 88 ++++++ .../patches/patch-libAfterStep_parser__xml.c | 15 ++ 14 files changed, 912 insertions(+), 10 deletions(-) create mode 100644 wm/afterstep/patches/patch-libAfterBase_output.c create mode 100644 wm/afterstep/patches/patch-libAfterConf_Color.c create mode 100644 wm/afterstep/patches/patch-libAfterConf_DesktopEntry.c create mode 100644 wm/afterstep/patches/patch-libAfterStep_asapp.c create mode 100644 wm/afterstep/patches/patch-libAfterStep_font.c create mode 100644 wm/afterstep/patches/patch-libAfterStep_freestor.c create mode 100644 wm/afterstep/patches/patch-libAfterStep_hints.c create mode 100644 wm/afterstep/patches/patch-libAfterStep_kde.c create mode 100644 wm/afterstep/patches/patch-libAfterStep_parser.c create mode 100644 wm/afterstep/patches/patch-libAfterStep_parser__xml.c (limited to 'wm') diff --git a/wm/afterstep/distinfo b/wm/afterstep/distinfo index f6c539dd965..c8929ac39bf 100644 --- a/wm/afterstep/distinfo +++ b/wm/afterstep/distinfo @@ -1,4 +1,4 @@ -$NetBSD: distinfo,v 1.19 2015/11/02 23:42:50 agc Exp $ +$NetBSD: distinfo,v 1.20 2016/05/01 19:26:34 dholland Exp $ SHA1 (AfterStep-2.2.11.tar.bz2) = ecfd815b659046281530441af0bc4fc42900d0da RMD160 (AfterStep-2.2.11.tar.bz2) = a82a4b3fddcbcd97862212669c11d14629e51a4d @@ -10,15 +10,25 @@ SHA1 (patch-configure) = 081192b46d025d9da4c5bc1bbb1e65717a8ed655 SHA1 (patch-libAfterBase_ashash.c) = 36a1e19a017186aac7829071fa551eb6fe187609 SHA1 (patch-libAfterBase_asvector.c) = d892e192304a23f32d2c088932f3777b36a026d4 SHA1 (patch-libAfterBase_asvector.h) = d96a967b81d47c3c4a3c1f82e4e8e42fc2e15d7b -SHA1 (patch-libAfterBase_parse.c) = 8d4b65a5d22ffe90c62c6169cebba204d99c73ac +SHA1 (patch-libAfterBase_output.c) = fe0d9b4cbe3c2d1eac50e4c4c0d6fbd3b8b7487f +SHA1 (patch-libAfterBase_parse.c) = aba8ed0b11821ed09ded8833140c250abf6ea6da SHA1 (patch-libAfterBase_parse.h) = 18dfeb9444a7760df18a41069557b01b8b723c3b +SHA1 (patch-libAfterConf_Color.c) = 346f16a2ea539cb0ff352b73ba1f60d522efea00 +SHA1 (patch-libAfterConf_DesktopEntry.c) = 18ef3043768e8dc49c7147752649ce9cfe86d3f4 SHA1 (patch-libAfterImage_asfont.c) = f7ed285b39ba13126531b3e755e20895b1c3857b SHA1 (patch-libAfterImage_export.c) = 0b450561673cb3351c2f8685ba7357cc6a1de366 -SHA1 (patch-libAfterImage_import.c) = 46034b8fac4dd59c46d7491f522512a5de462def -SHA1 (patch-libAfterStep_functions.c) = ae5b9aeca0046d034a59188cc9977e55605a2b7c +SHA1 (patch-libAfterImage_import.c) = 57fdfec498ba05aa6d52470c545d1c9958095435 +SHA1 (patch-libAfterStep_asapp.c) = 3d23d40b862aca272aac3e35574f6bf99cbc8e0a +SHA1 (patch-libAfterStep_font.c) = e47477b5d0a0b54af19d603eb37937dbfa24dd19 +SHA1 (patch-libAfterStep_freestor.c) = e66249ff9edc2f7441e406aa34db923420b201d6 +SHA1 (patch-libAfterStep_functions.c) = a01482b2eff7d659afc98aa028191cca65465d0b SHA1 (patch-libAfterStep_functions.h) = 501e1a95419a8933b918f7d8df28df38e810f69a +SHA1 (patch-libAfterStep_hints.c) = 78e336ce1350f6d98ad984fd2d7054449f0d609f +SHA1 (patch-libAfterStep_kde.c) = 3e10900fe71d659afb99c9580f32829d1483d81f SHA1 (patch-libAfterStep_mylook.c) = 56dea9a5acb65dee3faa5adf350c8901bbd495e2 SHA1 (patch-libAfterStep_mylook.h) = 8fede622d4737510880b88c3cf4b94f13e4892f1 +SHA1 (patch-libAfterStep_parser.c) = 668f28c566156fb627482d558d3eb2bb5707c92b +SHA1 (patch-libAfterStep_parser__xml.c) = d78190be5f4d05b849c92870782c780e9e951d83 SHA1 (patch-src_ASDocGen_Makefile.in) = 36185b1db36dfda33ef1503d55855e9bbf1ea286 SHA1 (patch-src_Animate_Makefile.in) = 5a0db32f7e6acc70cd8778b9d6c2d8d8b379acc9 SHA1 (patch-src_afterstep_asinternals.h) = c19f912d19635dba8c8e07e9ccf7b7463728c9ef diff --git a/wm/afterstep/patches/patch-libAfterBase_output.c b/wm/afterstep/patches/patch-libAfterBase_output.c new file mode 100644 index 00000000000..98e562e7676 --- /dev/null +++ b/wm/afterstep/patches/patch-libAfterBase_output.c @@ -0,0 +1,18 @@ +$NetBSD: patch-libAfterBase_output.c,v 1.1 2016/05/01 19:26:34 dholland Exp $ + +Fix printing of times. + +--- libAfterBase/output.c~ 2006-03-29 00:11:15.000000000 +0000 ++++ libAfterBase/output.c +@@ -219,9 +219,9 @@ void debugout_print_linestamp(const char + last_timestamp = tv.tv_sec ; + } + if( line > 0 ) +- fprintf( stderr, "%s:%2.2li.%5.5li:%s:%s:%d>", ApplicationName, tv.tv_sec-startup_time, tv.tv_usec/10, file, func, line ); ++ fprintf( stderr, "%s:%2.2lld.%5.5ld:%s:%s:%d>", ApplicationName, (long long)(tv.tv_sec-startup_time), (long)(tv.tv_usec/10), file, func, line ); + else +- fprintf( stderr, "%s:%2.2li.%5.5li:%s:%s>", ApplicationName, tv.tv_sec-startup_time, tv.tv_usec/10, file, func ); ++ fprintf( stderr, "%s:%2.2lld.%5.5ld:%s:%s>", ApplicationName, (long long)(tv.tv_sec-startup_time), (long)(tv.tv_usec/10), file, func ); + + } + diff --git a/wm/afterstep/patches/patch-libAfterBase_parse.c b/wm/afterstep/patches/patch-libAfterBase_parse.c index 2bfed336340..84cd561b5bd 100644 --- a/wm/afterstep/patches/patch-libAfterBase_parse.c +++ b/wm/afterstep/patches/patch-libAfterBase_parse.c @@ -1,7 +1,280 @@ -$NetBSD: patch-libAfterBase_parse.c,v 1.1 2013/06/26 21:17:45 joerg Exp $ +$NetBSD: patch-libAfterBase_parse.c,v 1.2 2016/05/01 19:26:35 dholland Exp $ ---- libAfterBase/parse.c.orig 2013-06-26 19:46:08.000000000 +0000 +- Use ctype.h correctly. +- Patch up gcc inline mess. + +--- libAfterBase/parse.c.orig 2009-02-11 23:32:02.000000000 +0000 +++ libAfterBase/parse.c +@@ -119,7 +119,7 @@ const char *parse_argb_part( const char + + for( i = 0 ; i < 3 ; ++i ) + { +- if( !isdigit(ptr[i]) ) ++ if( !isdigit((unsigned char)ptr[i]) ) + break; + buf[i] = ptr[i] ; + } +@@ -279,7 +279,7 @@ const char *parse_hsv_part( const char * + + for( i = 0 ; i < 3 ; ++i ) + { +- if( !isdigit(ptr[i]) ) ++ if( !isdigit((unsigned char)ptr[i]) ) + break; + buf[i] = ptr[i] ; + } +@@ -328,7 +328,7 @@ const char *parse_argb_dec( const char * + + for( k = has_alpha?0:1 ; k < 4 ; ++k ) + { +- if( !isdigit(ptr[0]) ) ++ if( !isdigit((unsigned char)ptr[0]) ) + { + CARD32 tmp_argb = 0xFF000000 ; + const char *tmp = parse_argb_color( ptr, &tmp_argb ); +@@ -350,14 +350,14 @@ const char *parse_argb_dec( const char * + { + for( i = 0 ; i < 3 ; ++i ) + { +- if( !isdigit(ptr[i]) ) ++ if( !isdigit((unsigned char)ptr[i]) ) + break; + buf[i] = ptr[i] ; + } + buf[i] = '\0' ; + dec_val[k] = atoi( &(buf[0]) ); + } +- if( !isdigit(ptr[i]) ) ++ if( !isdigit((unsigned char)ptr[i]) ) + { + if( ptr[i] != ',' ) + break; +@@ -394,15 +394,15 @@ const char *parse_argb_color( const char + CARD32 argb = 0 ; + int len = 0 ; + register const char *ptr = color+1 ; +- while( isxdigit((int)ptr[len]) ) len++; ++ while( isxdigit((unsigned char)ptr[len]) ) len++; + if( len >= 3) + { + if( (len&0x3) == 0 && len != 12 ) + { /* we do have alpha channel !!! */ + len = len>>2 ; +- argb = (hextoi((int)ptr[0])<<28)&0xF0000000 ; ++ argb = ((unsigned)hextoi((unsigned char)ptr[0])<<28)&0xF0000000 ; + if( len > 1 ) +- argb |= (hextoi((int)ptr[1])<<24)&0x0F000000 ; ++ argb |= ((unsigned)hextoi((unsigned char)ptr[1])<<24)&0x0F000000 ; + else + argb |= 0x0F000000; + ptr += len ; +@@ -415,20 +415,20 @@ const char *parse_argb_color( const char + if( len == 1 ) + { + argb |= 0x000F0F0F; +- argb |= (hextoi((int)ptr[0])<<20)&0x00F00000 ; +- argb |= (hextoi((int)ptr[1])<<12)&0x0000F000 ; +- argb |= (hextoi((int)ptr[2])<<4 )&0x000000F0 ; ++ argb |= ((unsigned)hextoi((unsigned char)ptr[0])<<20)&0x00F00000 ; ++ argb |= ((unsigned)hextoi((unsigned char)ptr[1])<<12)&0x0000F000 ; ++ argb |= ((unsigned)hextoi((unsigned char)ptr[2])<<4 )&0x000000F0 ; + ptr += 3 ; + }else + { +- argb |= (hextoi((int)ptr[0])<<20)&0x00F00000 ; +- argb |= (hextoi((int)ptr[1])<<16)&0x000F0000 ; ++ argb |= ((unsigned)hextoi((unsigned char)ptr[0])<<20)&0x00F00000 ; ++ argb |= ((unsigned)hextoi((unsigned char)ptr[1])<<16)&0x000F0000 ; + ptr += len ; +- argb |= (hextoi((int)ptr[0])<<12)&0x0000F000 ; +- argb |= (hextoi((int)ptr[1])<<8) &0x00000F00 ; ++ argb |= ((unsigned)hextoi((unsigned char)ptr[0])<<12)&0x0000F000 ; ++ argb |= ((unsigned)hextoi((unsigned char)ptr[1])<<8) &0x00000F00 ; + ptr += len ; +- argb |= (hextoi((int)ptr[0])<<4 )&0x000000F0 ; +- argb |= (hextoi((int)ptr[1])) &0x0000000F ; ++ argb |= ((unsigned)hextoi((unsigned char)ptr[0])<<4 )&0x000000F0 ; ++ argb |= ((unsigned)hextoi((unsigned char)ptr[1])) &0x0000000F ; + ptr += len ; + } + *pargb = argb ; +@@ -486,7 +486,7 @@ const char *parse_argb_color( const char + register int i = 0; + Bool success = True ; + +- while( isalnum((int)ptr[i]) ) ++i; ++ while( isalnum((unsigned char)ptr[i]) ) ++i; + if( ptr[i] != '\0' ) + ptr = mystrndup(&(color[0]), i ); + +@@ -514,7 +514,7 @@ const char *parse_argb_color( const char + int orig_i = i ; + ptr = (char*)&(color[0]); + +- while( isalnum((int)ptr[i]) || ptr[i] == '.' || ptr[i] == '_') ++i; ++ while( isalnum((unsigned char)ptr[i]) || ptr[i] == '.' || ptr[i] == '_') ++i; + if( orig_i < i ) + { + if( ptr[i] != '\0' ) +@@ -590,8 +590,8 @@ stripcpy (const char *source) + + if( source == NULL ) + return NULL; +- for (; isspace ((int)*source); source++); +- for (ptr = source + strlen (source); ptr > source && isspace ((int)*(ptr - 1)); ptr--); ++ for (; isspace ((unsigned char)*source); source++); ++ for (ptr = source + strlen (source); ptr > source && isspace ((unsigned char)*(ptr - 1)); ptr--); + return mystrndup (source, ptr - source); + } + +@@ -627,7 +627,7 @@ stripcomments2 (char *source, char **com + int start = 0, curr = 0 ; + + /* remove comments from the line */ +- while (isspace ((int)source[start])) ++start; ++ while (isspace ((unsigned char)source[start])) ++start; + + for (curr = start; source[curr]; curr++) + { +@@ -645,9 +645,9 @@ stripcomments2 (char *source, char **com + { /* checking if it is not a hex color code */ + int i = curr; + +- while(isxdigit ((int)source[++i])); ++ while(isxdigit ((unsigned char)source[++i])); + +- if (i-curr < 4 || i-curr > 13 || (source[i] && !isspace ((int)source[i]))) ++ if (i-curr < 4 || i-curr > 13 || (source[i] && !isspace ((unsigned char)source[i]))) + { + if( comments ) + *comments = mystrdup( &source[curr+1] ); +@@ -657,7 +657,7 @@ stripcomments2 (char *source, char **com + curr = i - 1; + } + } +- do{ --curr ; }while( curr > start && isspace ((int)source[curr])); ++ do{ --curr ; }while( curr > start && isspace ((unsigned char)source[curr])); + source[curr+1] = '\0'; + return &source[start]; + } +@@ -676,10 +676,10 @@ strip_whitespace (char *str) + char *ptr; + + /* strip trailing whitespace */ +- for (ptr = str + strlen (str); ptr > str && isspace ((int)*(ptr - 1)); ptr--) ++ for (ptr = str + strlen (str); ptr > str && isspace ((unsigned char)*(ptr - 1)); ptr--) + *(ptr - 1) = '\0'; + /* skip leading whitespace */ +- for (ptr = str; isspace ((int)*ptr); ptr++); ++ for (ptr = str; isspace ((unsigned char)*ptr); ptr++); + return ptr; + } + +@@ -699,7 +699,7 @@ tokenskip( const char *ptr, unsigned int + if( ptr == NULL ) return NULL ; + while( ++tok_no <= n_tokens && ptr[curr] != '\0' ) + { +- while (!isspace ((int)ptr[curr]) && ptr[curr]) ++ while (!isspace ((unsigned char)ptr[curr]) && ptr[curr]) + { /* we have to match doublequotes if we encounter any, to allow for spaces in filenames */ + if (ptr[curr] == '"') + { +@@ -710,7 +710,7 @@ tokenskip( const char *ptr, unsigned int + ++curr; + } + +- while (isspace ((int)ptr[curr])) ++curr; ++ while (isspace ((unsigned char)ptr[curr])) ++curr; + } + return (char*)&ptr[curr]; + } +@@ -725,12 +725,12 @@ parse_token (const char *source, char ** + { + int tok_start = 0, tok_end; + char *next_tok_ptr ; +- while( isspace(source[tok_start]) ) ++tok_start; ++ while( isspace((unsigned char)source[tok_start]) ) ++tok_start; + next_tok_ptr = tokenskip( &source[tok_start], 1 ); + tok_end = (int)(next_tok_ptr-source) ; + if( tok_end > tok_start ) + if( source[tok_end] != '\0' ) /* then it points to beginning of the next token */ +- do{ --tok_end;}while( tok_end > tok_start && isspace(source[tok_end-1])); ++ do{ --tok_end;}while( tok_end > tok_start && isspace((unsigned char)source[tok_end-1])); + + if( trg ) + *trg = mystrndup (&source[tok_start], tok_end - tok_start ); +@@ -752,7 +752,7 @@ parse_tab_token (const char *source, cha + { + char *ptr; + +- for (; isspace ((int)*source); source++); ++ for (; isspace ((unsigned char)*source); source++); + for (ptr = (char *)source; *ptr != '\t' && *ptr; ptr++); + *trg = mystrndup (source, ptr - source); + return ptr; +@@ -806,7 +806,7 @@ make_shell_str (char *dest, const char * + n--; + while (n && *src) + { +- if (!isalnum ((int)*src) && n > 1) ++ if (!isalnum ((unsigned char)*src) && n > 1) + { + *dest++ = '\\'; + n--; +@@ -853,7 +853,7 @@ parse_signed_int (register char *tline, + int val = 0, sign = 0; + register int i = 0 ; + +- while (isspace ((int)tline[i])) ++i; ++ while (isspace ((unsigned char)tline[i])) ++i; + + switch( tline[i] ) + { /* handling constructs like --10 or -+10 which is equivalent to -0-10or -0+10 */ +@@ -875,7 +875,7 @@ parse_signed_int (register char *tline, + case 'X' : sign = 4; break; + default : --i ; + } +- while (isdigit ((int)tline[++i])) ++ while (isdigit ((unsigned char)tline[++i])) + val = val * 10 + (int)(tline[i] - '0'); + + if( val_return ) +@@ -891,7 +891,7 @@ parse_func_args (char *tline, char *unit + tline = parse_signed_int( tline, func_val, NULL ); + + *unit = *tline; +- if (isspace ((int)*tline)) ++ if (isspace ((unsigned char)*tline)) + *unit = '\0' ; + return tline[0]?tline+1:tline; + } +@@ -906,7 +906,7 @@ double parse_math(const char* str, char* + if( str == NULL ) + return 0 ; + +- while (isspace((int)*str)) str++; ++ while (isspace((unsigned char)*str)) str++; + if( *str == '!' ) + { + logical_not = 1; +@@ -919,7 +919,7 @@ double parse_math(const char* str, char* + + while (*str) + { +- while (isspace((int)*str)) str++; ++ while (isspace((unsigned char)*str)) str++; + if (!op) + { + if (*str == '+' || *str == '-' || *str == '*' || *str == '/') op = *str++; +@@ -936,7 +936,7 @@ double parse_math(const char* str, char* + num = parse_math(str + 1, &ptr, size); + else if (*str == '$') + { +- for (ptr = (char*)str + 1 ; *ptr && !isspace(*ptr) && *ptr != '+' && *ptr != '-' && *ptr != '*' && *ptr != '!' && *ptr != '/' && *ptr != ')' ; ptr++); ++ for (ptr = (char*)str + 1 ; *ptr && !isspace((unsigned char)*ptr) && *ptr != '+' && *ptr != '-' && *ptr != '*' && *ptr != '!' && *ptr != '/' && *ptr != ')' ; ptr++); + num = asxml_var_nget((char*)str + 1, ptr - (str + 1)); + }else + num = strtod(str, &ptr); @@ -1027,7 +1027,7 @@ parse_geometry (register char *tline, static char _as_hex_to_char_table[] = "0123456789ABCDEF"; @@ -11,3 +284,21 @@ $NetBSD: patch-libAfterBase_parse.c,v 1.1 2013/06/26 21:17:45 joerg Exp $ unsigned_int2buffer_end (char *buffer, int buffer_size, unsigned int val) { int i = buffer_size-1 ; +@@ -1174,7 +1174,7 @@ get_string_list_item (char *ptr, char ** + + if (ptr == NULL) + return NULL; +- while (*ptr && (isspace ((int)*ptr) || *ptr == separator)) ++ while (*ptr && (isspace ((unsigned char)*ptr) || *ptr == separator)) + ptr++; + if (*ptr == '\0') + return NULL; +@@ -1185,7 +1185,7 @@ get_string_list_item (char *ptr, char ** + if ((*item_end = find_doublequotes (ptr)) == NULL) + return NULL; + ptr = *item_end; +- while (*ptr && !(isspace ((int)*ptr) || *ptr == separator)) ++ while (*ptr && !(isspace ((unsigned char)*ptr) || *ptr == separator)) + ptr++; + } else + { diff --git a/wm/afterstep/patches/patch-libAfterConf_Color.c b/wm/afterstep/patches/patch-libAfterConf_Color.c new file mode 100644 index 00000000000..7ce23bac2ab --- /dev/null +++ b/wm/afterstep/patches/patch-libAfterConf_Color.c @@ -0,0 +1,43 @@ +$NetBSD: patch-libAfterConf_Color.c,v 1.1 2016/05/01 19:26:35 dholland Exp $ + +Use ctype.h correctly. +Fix some printf formats. + +--- libAfterConf/Color.c~ 2008-03-21 22:48:51.000000000 +0000 ++++ libAfterConf/Color.c +@@ -326,7 +326,7 @@ translate_gtkrc_template_file( const ch + while( fgets( &buffer[0], MAXLINELENGTH, src_fp ) ) + { + int i = 0; +- while( isspace(buffer[i]) )++i ; ++ while( isspace((unsigned char)buffer[i]) )++i ; + if( buffer[i] != '\n' && buffer[i] != '#' && buffer[i] != '\0' && buffer[i] != '\r' ) + { + ++good_strings; +@@ -342,7 +342,7 @@ translate_gtkrc_template_file( const ch + if(buffer[i] == '\"' ) + { + char *token = &buffer[i+1] ; +- if( isalpha(token[0]) ) ++ if( isalpha((unsigned char)token[0]) ) + { + int len = 0 ; + while( token[len] != '\0' && token[len] != '\"' ) ++len ; +@@ -352,7 +352,7 @@ translate_gtkrc_template_file( const ch + if( parse_argb_color( token, &argb ) != token ) + { + fwrite( &(buffer[0]), 1, i+1, dst_fp ); +- fprintf( dst_fp, "#%2.2lX%2.2lX%2.2lX", ARGB32_RED8(argb), ARGB32_GREEN8(argb), ARGB32_BLUE8(argb) ); ++ fprintf( dst_fp, "#%2.2lX%2.2lX%2.2lX", (unsigned long)ARGB32_RED8(argb), (unsigned long)ARGB32_GREEN8(argb), (unsigned long)ARGB32_BLUE8(argb) ); + fwrite( &(token[len]), 1, strlen(&(token[len])), dst_fp ); + continue; + } +@@ -398,7 +398,7 @@ translate_kcsrc_template_file( const ch + if( parse_argb_color( parm, &argb ) != parm ) + { + char *tmp = safemalloc( 32 ); +- sprintf( tmp, "%ld,%ld,%ld", ARGB32_RED8(argb), ARGB32_GREEN8(argb), ARGB32_BLUE8(argb) ); ++ sprintf( tmp, "%ld,%ld,%ld", (unsigned long)ARGB32_RED8(argb), (unsigned long)ARGB32_GREEN8(argb), (unsigned long)ARGB32_BLUE8(argb) ); + free( item->child->parm ); + item->child->parm = tmp; + } diff --git a/wm/afterstep/patches/patch-libAfterConf_DesktopEntry.c b/wm/afterstep/patches/patch-libAfterConf_DesktopEntry.c new file mode 100644 index 00000000000..5640e1109da --- /dev/null +++ b/wm/afterstep/patches/patch-libAfterConf_DesktopEntry.c @@ -0,0 +1,50 @@ +$NetBSD: patch-libAfterConf_DesktopEntry.c,v 1.1 2016/05/01 19:26:35 dholland Exp $ + +--- libAfterConf/DesktopEntry.c~ 2007-07-13 17:18:26.000000000 +0000 ++++ libAfterConf/DesktopEntry.c +@@ -88,14 +88,14 @@ filter_desktop_entry_exec( const char *e + char *clean_exec = mystrdup(exec); + int start = 0, ts; + +- while( clean_exec[start] != '\0' && !isspace(clean_exec[start]) ) ++start; ++ while( clean_exec[start] != '\0' && !isspace((unsigned char)clean_exec[start]) ) ++start; + while( clean_exec[start] != '\0') + { + ts = start ; +- while( isspace(clean_exec[ts]) ) ++ts; +- if( clean_exec[ts] == '%' && isalpha(clean_exec[ts+1]) ) ++ while( isspace((unsigned char)clean_exec[ts]) ) ++ts; ++ if( clean_exec[ts] == '%' && isalpha((unsigned char)clean_exec[ts+1]) ) + { +- while( !isspace(clean_exec[ts]) && clean_exec[ts] != '\0' ) ++ while( !isspace((unsigned char)clean_exec[ts]) && clean_exec[ts] != '\0' ) + { + clean_exec[ts] = ' ' ; + ++ts ; +@@ -104,12 +104,12 @@ filter_desktop_entry_exec( const char *e + }else if( mystrncasecmp(&clean_exec[ts], "-caption ", 9 ) == 0 ) + { + ts += 9 ; +- while( isspace(clean_exec[ts]) ) ++ts; ++ while( isspace((unsigned char)clean_exec[ts]) ) ++ts; + if( mystrncasecmp(&clean_exec[ts], "\"%c\"", 4 ) == 0 ) + { + ts += 3 ; + while( start < ts ) clean_exec[++start] = ' '; +- }else if( clean_exec[ts] == '%' && isalpha(clean_exec[ts+1]) ) ++ }else if( clean_exec[ts] == '%' && isalpha((unsigned char)clean_exec[ts+1]) ) + { + ts += 1 ; + while( start < ts ) clean_exec[++start] = ' '; +@@ -123,9 +123,9 @@ filter_desktop_entry_exec( const char *e + start = ts ; + ++start; + }else +- for( start = ts ; !isspace(clean_exec[start]) && clean_exec[start] != '\0' ; ++start ); ++ for( start = ts ; !isspace((unsigned char)clean_exec[start]) && clean_exec[start] != '\0' ; ++start ); + } +- while( isspace(clean_exec[start-1])) ++ while( isspace((unsigned char)clean_exec[start-1])) + { + --start ; + clean_exec[start] = '\0' ; diff --git a/wm/afterstep/patches/patch-libAfterImage_import.c b/wm/afterstep/patches/patch-libAfterImage_import.c index 784902713aa..be7a5d3a6ec 100644 --- a/wm/afterstep/patches/patch-libAfterImage_import.c +++ b/wm/afterstep/patches/patch-libAfterImage_import.c @@ -1,7 +1,74 @@ -$NetBSD: patch-libAfterImage_import.c,v 1.2 2013/04/07 10:36:54 cheusov Exp $ -* fix for png-1.5 +$NetBSD: patch-libAfterImage_import.c,v 1.3 2016/05/01 19:26:35 dholland Exp $ + +- use ctype.h correctly +- fix for png-1.5 + --- libAfterImage/import.c.orig 2010-09-23 20:57:57.000000000 +0000 +++ libAfterImage/import.c +@@ -221,7 +221,7 @@ char *locate_image_file_in_path( const c + if( realfilename == NULL ) + { /* let's try and see if we have subimage number appended */ + for( i = filename_len-1 ; i > 0; i-- ) +- if( !isdigit( (int)tmp[i] ) ) ++ if( !isdigit( (unsigned char)tmp[i] ) ) + break; + if( i < filename_len-1 && i > 0 ) + if( tmp[i] == '.' ) /* we have possible subimage number */ +@@ -878,7 +878,7 @@ load_asimage_list_entry_data( ASImageLis + int i = entry->buffer->size ; + register char *ptr = entry->buffer->data ; + while ( --i >= 0 ) +- if( !isprint(ptr[i]) && ptr[i] != '\n'&& ptr[i] != '\r'&& ptr[i] != '\t' ) ++ if( !isprint((unsigned char)ptr[i]) && ptr[i] != '\n'&& ptr[i] != '\r'&& ptr[i] != '\t' ) + break; + binary = (i >= 0); + }else +@@ -980,7 +980,7 @@ check_image_type( const char *realfilena + type = ASIT_Gif; + else if (head[0] == head[1] && (head[0] == 'I' || head[0] == 'M')) + type = ASIT_Tiff; +- else if (head[0] == 'P' && isdigit(head[1])) ++ else if (head[0] == 'P' && isdigit((unsigned char)head[1])) + type = (head[1]!='5' && head[1]!='6')?ASIT_Pnm:ASIT_Ppm; + else if (head[0] == 0xa && head[1] <= 5 && head[2] == 1) + type = ASIT_Pcx; +@@ -1014,13 +1014,13 @@ check_image_type( const char *realfilena + int i ; + + type = ASIT_XMLScript ; +- for( i = 0 ; i < bytes_in ; ++i ) if( !isspace(head[i]) ) break; ++ for( i = 0 ; i < bytes_in ; ++i ) if( !isspace((unsigned char)head[i]) ) break; + while( bytes_in > 0 && type == ASIT_XMLScript ) + { + if( i >= bytes_in ) + { + bytes_in = fread( &(head[0]), sizeof(CARD8), FILE_HEADER_SIZE, fp ); +- for( i = 0 ; i < bytes_in ; ++i ) if( !isspace(head[i]) ) break; ++ for( i = 0 ; i < bytes_in ; ++i ) if( !isspace((unsigned char)head[i]) ) break; + } + else if( head[i] != '<' ) + type = ASIT_Unknown ; +@@ -1030,7 +1030,7 @@ check_image_type( const char *realfilena + }else if( mystrncasecmp( &(head[i]), " 0 && type == ASIT_XMLScript ) + { + while( ++i < bytes_in ) +- if( !isspace(head[i]) ) ++ if( !isspace((unsigned char)head[i]) ) + { +- if( !isprint(head[i]) ) ++ if( !isprint((unsigned char)head[i]) ) + { + type = ASIT_Unknown ; + break ; @@ -1251,7 +1251,7 @@ png2ASImage_int( void *data, png_rw_ptr * the normal method of doing things with libpng). REQUIRED unless you * set up your own error handlers in the png_create_read_struct() earlier. @@ -31,3 +98,14 @@ $NetBSD: patch-libAfterImage_import.c,v 1.2 2013/04/07 10:36:54 cheusov Exp $ memcpy(data, buf->buffer, length); buf->buffer += length; } +@@ -1828,8 +1828,8 @@ ppm2ASImage( const char * path, ASImageI + break; + } + width = atoi( &(buffer[i]) ); +- while ( buffer[i] != '\0' && !isspace((int)buffer[i]) ) ++i; +- while ( isspace((int)buffer[i]) ) ++i; ++ while ( buffer[i] != '\0' && !isspace((unsigned char)buffer[i]) ) ++i; ++ while ( isspace((unsigned char)buffer[i]) ) ++i; + if( buffer[i] != '\0') + height = atoi(&(buffer[i])); + } diff --git a/wm/afterstep/patches/patch-libAfterStep_asapp.c b/wm/afterstep/patches/patch-libAfterStep_asapp.c new file mode 100644 index 00000000000..d26e3ac03ef --- /dev/null +++ b/wm/afterstep/patches/patch-libAfterStep_asapp.c @@ -0,0 +1,33 @@ +$NetBSD: patch-libAfterStep_asapp.c,v 1.1 2016/05/01 19:26:35 dholland Exp $ + +Use ctype.h correctly. + +--- libAfterStep/asapp.c~ 2009-10-05 16:32:59.000000000 +0000 ++++ libAfterStep/asapp.c +@@ -1208,7 +1208,7 @@ spawn_child( const char *cmd, int single + + while( display[i] ) ++i; + +- while( i > 0 && isdigit(display[--i]) ); ++ while( i > 0 && isdigit((unsigned char)display[--i]) ); + if( display[i] == '.' ) + display[i+1] = '\0' ; + /* +@@ -1288,7 +1288,7 @@ spawn_child( const char *cmd, int single + if( as_app_args.verbosity_level != OUTPUT_DEFAULT_THRESHOLD ) + ptr += sprintf( ptr, " -V %d", as_app_args.verbosity_level ); + LOCAL_DEBUG_OUT( "len = %d, cmdl = \"%s\" strlen = %d, locale = \"%s\", ptr-cmdl = %d", len, cmdl, (int)strlen(cmdl), as_app_args.locale, (int)(ptr-cmdl) ); +- if( as_app_args.locale && as_app_args.locale[0] && !isspace(as_app_args.locale[0])) ++ if( as_app_args.locale && as_app_args.locale[0] && !isspace((unsigned char)as_app_args.locale[0])) + ptr += sprintf( ptr, " -L %s", as_app_args.locale ); + + #ifdef DEBUG_TRACE_X +@@ -1314,7 +1314,7 @@ LOCAL_DEBUG_OUT( "len = %d, cmdl = \"%s\ + if( do_fork ) + { + int i = ptr-cmdl; +- while( --i >= 0 ) if( !isspace(cmdl[i]) ) break; ++ while( --i >= 0 ) if( !isspace((unsigned char)cmdl[i]) ) break; + do_fork = ( i < 0 || cmdl[i] != '&' ); + } + strcpy (ptr, do_fork?" &\n":"\n"); diff --git a/wm/afterstep/patches/patch-libAfterStep_font.c b/wm/afterstep/patches/patch-libAfterStep_font.c new file mode 100644 index 00000000000..af7c2d74025 --- /dev/null +++ b/wm/afterstep/patches/patch-libAfterStep_font.c @@ -0,0 +1,22 @@ +$NetBSD: patch-libAfterStep_font.c,v 1.1 2016/05/01 19:26:35 dholland Exp $ + +Use ctype.h correctly. + +--- libAfterStep/font.c~ 2007-07-10 17:48:06.000000000 +0000 ++++ libAfterStep/font.c +@@ -50,12 +50,12 @@ load_font (const char *name_in, MyFont * + register char *ptr = clean_name ; + while( ptr[i] ) ++i ; + while( --i >= 0 ) +- if( !isdigit(ptr[i]) ) ++ if( !isdigit((unsigned char)ptr[i]) ) + break; +- if( (isspace( ptr[i] ) || ptr[i] == '-') && ptr[i+1] ) ++ if( (isspace( (unsigned char)ptr[i] ) || ptr[i] == '-') && ptr[i+1] ) + { + font_size = atoi( &(ptr[i+1]) ); +- while( i > 0 && isspace(ptr[i-1]) ) --i ; ++ while( i > 0 && isspace((unsigned char)ptr[i-1]) ) --i ; + clean_name = mystrndup( name, i ); + } + } diff --git a/wm/afterstep/patches/patch-libAfterStep_freestor.c b/wm/afterstep/patches/patch-libAfterStep_freestor.c new file mode 100644 index 00000000000..b47448a6203 --- /dev/null +++ b/wm/afterstep/patches/patch-libAfterStep_freestor.c @@ -0,0 +1,98 @@ +$NetBSD: patch-libAfterStep_freestor.c,v 1.1 2016/05/01 19:26:35 dholland Exp $ + +Use ctype.h correctly. + +--- libAfterStep/freestor.c~ 2008-06-13 16:32:51.000000000 +0000 ++++ libAfterStep/freestor.c +@@ -478,11 +478,11 @@ args2FreeStorage (FreeStorageElem * pele + cur = data; + while (*cur) + { +- if (!isspace ((int)*cur)) ++ if (!isspace ((unsigned char)*cur)) + max_argc++; +- while (!isspace ((int)*cur) && *cur) ++ while (!isspace ((unsigned char)*cur) && *cur) + cur++; +- while (isspace ((int)*cur) && *cur) ++ while (isspace ((unsigned char)*cur) && *cur) + cur++; + } + } else +@@ -501,7 +501,7 @@ args2FreeStorage (FreeStorageElem * pele + while (argc < max_argc) + { + dst = argv[argc]; +- while (!isspace ((int)*cur) && *cur) ++ while (!isspace ((unsigned char)*cur) && *cur) + { + if (*cur == '"') + { +@@ -520,7 +520,7 @@ args2FreeStorage (FreeStorageElem * pele + if (++argc <= max_argc) + argv[argc] = dst; + +- while (isspace ((int)*cur) && *cur) ++ while (isspace ((unsigned char)*cur) && *cur) + cur++; + } + if (*cur && argc <= max_argc) +@@ -576,7 +576,7 @@ LOCAL_DEBUG_OUT("argv=%p, arc=%d, sub=%p + { + register char *cur = stored->argv[pos]; + +- if (isdigit ((int)*cur) || ((*cur == '-' || *cur == '+') && isdigit ((int)*(cur + 1)))) ++ if (isdigit ((unsigned char)*cur) || ((*cur == '-' || *cur == '+') && isdigit ((unsigned char)*(cur + 1)))) + break; + pos++; + } +@@ -833,14 +833,14 @@ parse_context (char *string, int *output + char tmp1; + + *output = 0; +- for (ptr = string; isspace (*ptr); ptr++); +- for (; *ptr && !isspace (*ptr); ptr++) ++ for (ptr = string; isspace ((unsigned char)*ptr); ptr++); ++ for (; *ptr && !isspace ((unsigned char)*ptr); ptr++) + { + /* in some BSD implementations, tolower(c) is not defined + * unless isupper(c) is true */ + tmp1 = *ptr; +- if (islower (tmp1)) +- tmp1 = toupper (tmp1); ++ if (islower ((unsigned char)tmp1)) ++ tmp1 = toupper ((unsigned char)tmp1); + /* end of ugly BSD patch */ + for (j = 0; table[j].key != 0; j++) + if (tmp1 == table[j].key) +@@ -904,7 +904,7 @@ context2string (char *string, int input, + string[i++] = table[j].key ; + if( terminate ) + { +- while ( string[i] != '\0' && !isspace((int)string[i])) i++; ++ while ( string[i] != '\0' && !isspace((unsigned char)string[i])) i++; + string[i] = '\0' ; + }else + string[j] = '\0' ; +@@ -955,10 +955,10 @@ free_storage2bitlist (FreeStorageElem * + ptr = stored->argv[i] ; + while ( *ptr ) + { +- while( *ptr && !isdigit((int)*ptr)) ptr++ ; ++ while( *ptr && !isdigit((unsigned char)*ptr)) ptr++ ; + bit_num = 0 ; + valid = False ; +- while( *ptr && isdigit((int)*ptr)) ++ while( *ptr && isdigit((unsigned char)*ptr)) + { + valid = True ; + bit_num = bit_num*10+((*ptr)-'0'); +@@ -1539,7 +1539,7 @@ Path2FreeStorage (SyntaxDef * syntax, Fr + register char *ptr; + + for (ptr = path; *ptr; ptr++) +- if (isspace ((int)*ptr)) ++ if (isspace ((unsigned char)*ptr)) + return QuotedString2FreeStorage (syntax, tail, index, path, id); + } + if (index) diff --git a/wm/afterstep/patches/patch-libAfterStep_functions.c b/wm/afterstep/patches/patch-libAfterStep_functions.c index dec2bb002b9..4ca69310655 100644 --- a/wm/afterstep/patches/patch-libAfterStep_functions.c +++ b/wm/afterstep/patches/patch-libAfterStep_functions.c @@ -1,7 +1,98 @@ -$NetBSD: patch-libAfterStep_functions.c,v 1.1 2012/05/04 16:36:10 joerg Exp $ +$NetBSD: patch-libAfterStep_functions.c,v 1.2 2016/05/01 19:26:35 dholland Exp $ ---- libAfterStep/functions.c.orig 2012-05-04 14:34:35.000000000 +0000 +- use ctype.h correctly +- patch up gcc inline mess + +--- libAfterStep/functions.c.orig 2009-12-11 22:38:48.000000000 +0000 +++ libAfterStep/functions.c +@@ -52,19 +52,19 @@ txt2func (const char *text, FunctionData + { + TermDef *fterm; + +- for (; isspace (*text); text++); ++ for (; isspace ((unsigned char)*text); text++); + fterm = txt2fterm (text, quiet); + if (fterm != NULL) + { + init_func_data (fdata); + fdata->func = fterm->id; +- for (; !isspace (*text) && *text; text++); +- for (; isspace (*text); text++); ++ for (; !isspace ((unsigned char)*text) && *text; text++); ++ for (; isspace ((unsigned char)*text); text++); + if (*text) + { + const char *ptr = text + strlen ((char*)text); + +- for (; isspace (*(ptr - 1)); ptr--); ++ for (; isspace ((unsigned char)*(ptr - 1)); ptr--); + fdata->text = mystrndup (text, ptr - text); + } + } +@@ -80,7 +80,7 @@ parse_func (const char *text, FunctionDa + int sign = 0; + + init_func_data (data); +- for (ptr = (char *)text; isspace (*ptr); ptr++); ++ for (ptr = (char *)text; isspace ((unsigned char)*ptr); ptr++); + if (*ptr == '\0') + { + if (!quiet) +@@ -94,7 +94,7 @@ parse_func (const char *text, FunctionDa + if (IsInternFunc (fterm->id)) + return 0; + +- while (!isspace (*ptr) && *ptr) ++ while (!isspace ((unsigned char)*ptr) && *ptr) + ptr++; + data->func = fterm->id; + if (fterm->flags & TF_SYNTAX_TERMINATOR) +@@ -109,14 +109,14 @@ parse_func (const char *text, FunctionDa + { /* we still want to strip trailing whitespaces */ + char *tail = ptr + strlen (ptr) - 1; + +- for (; isspace (*tail) && tail > ptr; tail--); ++ for (; isspace ((unsigned char)*tail) && tail > ptr; tail--); + *(tail + 1) = '\0'; + } + /* this function is very often called so we try to use as little + calls to other function as possible */ + for (; *ptr; ptr++) + { +- if (!isspace (*ptr)) ++ if (!isspace ((unsigned char)*ptr)) + { + int is_text = 0; + +@@ -138,15 +138,15 @@ parse_func (const char *text, FunctionDa + else if (data->text == NULL) + data->text = text; + ptr = tail + 1; +- } else if (isdigit (*ptr)) ++ } else if (isdigit ((unsigned char)*ptr)) + { + int count; + char unit = '\0'; + int val = 0; + +- for (count = 1; isdigit (*(ptr + count)); count++); +- if (*(ptr + count) != '\0' && !isspace (*(ptr + count))) +- is_text = (!isspace (*(ptr + count + 1)) && *(ptr + count + 1) != '\0') ? 1 : 0; ++ for (count = 1; isdigit ((unsigned char)*(ptr + count)); count++); ++ if (*(ptr + count) != '\0' && !isspace ((unsigned char)*(ptr + count))) ++ is_text = (!isspace ((unsigned char)*(ptr + count + 1)) && *(ptr + count + 1) != '\0') ? 1 : 0; + if (is_text == 0) + ptr = parse_func_args (ptr, &unit, &val) - 1; + if (curr_arg < MAX_FUNC_ARGS) +@@ -187,7 +187,7 @@ parse_func (const char *text, FunctionDa + } + ptr = parse_token (ptr, &(data->text)) - 1; + } else +- while (*(ptr + 1) && !isspace (*(ptr + 1))) ++ while (*(ptr + 1) && !isspace ((unsigned char)*(ptr + 1))) + ptr++; + } + sign = 0; @@ -314,7 +314,7 @@ dup_func_data (FunctionData * dst, Funct } } diff --git a/wm/afterstep/patches/patch-libAfterStep_hints.c b/wm/afterstep/patches/patch-libAfterStep_hints.c new file mode 100644 index 00000000000..9b64ab57ae9 --- /dev/null +++ b/wm/afterstep/patches/patch-libAfterStep_hints.c @@ -0,0 +1,42 @@ +$NetBSD: patch-libAfterStep_hints.c,v 1.1 2016/05/01 19:26:35 dholland Exp $ + +Use ctype.h correctly. + +--- libAfterStep/hints.c~ 2009-12-31 17:40:57.000000000 +0000 ++++ libAfterStep/hints.c +@@ -144,7 +144,7 @@ merge_command_line (ASHints * clean, ASS + { + register char *g = raw->wm_cmd_argv[i + 1]; + +- if (isdigit ((int)*g) || ((*g == '-' || *g == '+') && isdigit ((int)*(g + 1)))) ++ if (isdigit ((unsigned char)*g) || ((*g == '-' || *g == '+') && isdigit ((unsigned char)*(g + 1)))) + if (mystrcasecmp (raw->wm_cmd_argv[i], "-g") == 0 || + mystrcasecmp (raw->wm_cmd_argv[i], "-geometry") == 0) + { +@@ -168,7 +168,7 @@ merge_command_line (ASHints * clean, ASS + register int k ; + Bool add_quotes = False ; + for (k = 0; src[k]; k++) +- if( isspace(src[k]) || ++ if( isspace((unsigned char)src[k]) || + src[k] == '#' || + src[k] == '*' || + src[k] == '$' || +@@ -177,7 +177,7 @@ merge_command_line (ASHints * clean, ASS + src[k] == '<' || + src[k] == '>' || + src[k] == '|' || +- iscntrl(src[k]) ++ iscntrl((unsigned char)src[k]) + ) + { + add_quotes = True ; +@@ -2791,7 +2791,7 @@ get_client_icon_image( ScreenInfo * scr, + int i = 0; + char old ; + +- while( name[i] && !isspace(name[i]) ) ++i ; ++ while( name[i] && !isspace((unsigned char)name[i]) ) ++i ; + if( i > 0 ) + { + old = name[i]; diff --git a/wm/afterstep/patches/patch-libAfterStep_kde.c b/wm/afterstep/patches/patch-libAfterStep_kde.c new file mode 100644 index 00000000000..b13e37c34b7 --- /dev/null +++ b/wm/afterstep/patches/patch-libAfterStep_kde.c @@ -0,0 +1,23 @@ +$NetBSD: patch-libAfterStep_kde.c,v 1.1 2016/05/01 19:26:35 dholland Exp $ + +Use ctype.h correctly. + +--- libAfterStep/kde.c~ 2008-03-24 17:49:03.000000000 +0000 ++++ libAfterStep/kde.c +@@ -110,14 +110,14 @@ xml_elem_t* load_KDE_config(const char* + xml_elem_t* tag ; + int i = 0; + +- while( isspace(buffer[i]) ) ++i ; ++ while( isspace((unsigned char)buffer[i]) ) ++i ; + if( buffer[i] == '#' ) + { + ++i; + if( (tag = make_kde_config_comment_tag()) != NULL ) + { + int len = strlen( &buffer[i] ) ; +- while( len > 0 && isspace( buffer[i+len-1] ) ) --len ; ++ while( len > 0 && isspace( (unsigned char)buffer[i+len-1] ) ) --len ; + if( len > 0 ) + { + tag->child = create_CDATA_tag(); diff --git a/wm/afterstep/patches/patch-libAfterStep_parser.c b/wm/afterstep/patches/patch-libAfterStep_parser.c new file mode 100644 index 00000000000..d5f4b46e5ee --- /dev/null +++ b/wm/afterstep/patches/patch-libAfterStep_parser.c @@ -0,0 +1,88 @@ +$NetBSD: patch-libAfterStep_parser.c,v 1.1 2016/05/01 19:26:35 dholland Exp $ + +Use ctype.h correctly. + +--- libAfterStep/parser.c~ 2008-03-28 22:41:23.000000000 +0000 ++++ libAfterStep/parser.c +@@ -613,9 +613,9 @@ GetNextStatement (ConfigDef * config) + if (*cur == file_terminator) + return NULL; + #ifdef __CYGWIN__ +- if (!isspace ((int)*cur) && *cur != 0x0D) ++ if (!isspace ((unsigned char)*cur) && *cur != 0x0D) + #else +- if (!isspace ((int)*cur)) ++ if (!isspace ((unsigned char)*cur)) + #endif + { + register int i; +@@ -632,7 +632,7 @@ GetNextStatement (ConfigDef * config) + { /* comments - skip entire line */ + config->current_flags |= CF_DISABLED_OPTION; + /* let's skip few spaces here */ +- while (isspace ((int)cur[i]) && cur[i] != terminator) ++i; ++ while (isspace ((unsigned char)cur[i]) && cur[i] != terminator) ++i; + if (cur[i] == '\0' || cur[i] == terminator) + break; /* not a valid option */ + cur = &cur[i]; +@@ -647,7 +647,7 @@ GetNextStatement (ConfigDef * config) + print_trimmed_str( "private option at", cur ); + ++cur; + for( i = 0 ; mname[i] != '\0' && cur[i] != '\0' ; ++i ) +- if (tolower (mname[i]) != tolower (cur[i]) ) ++ if (tolower ((unsigned char)mname[i]) != tolower ((unsigned char)cur[i]) ) + break; + if (mname[i] != '\0') + { /* that was a foreign optiion - belongs to the other executable */ +@@ -673,9 +673,9 @@ GetNextStatement (ConfigDef * config) + if( *cur != COMMENTS_CHAR ) + { + i = 0 ; +- while (cur[i] && !isspace ((int)cur[i]) && cur[i] != terminator && cur[i] != file_terminator) ++ while (cur[i] && !isspace ((unsigned char)cur[i]) && cur[i] != terminator && cur[i] != file_terminator) + ++i; +- while (isspace ((int)cur[i]) && cur[i] != terminator && cur[i] != file_terminator) ++ while (isspace ((unsigned char)cur[i]) && cur[i] != terminator && cur[i] != file_terminator) + ++i; + }else + i = 1; +@@ -711,7 +711,7 @@ GetNextStatement (ConfigDef * config) + { + if (config->tdata[i] == file_terminator) + set_flags(config->current_flags, CF_LAST_OPTION); +- if (!isspace ((int)data[i])) ++ if (!isspace ((unsigned char)data[i])) + break; + } + i++; +@@ -750,10 +750,10 @@ FindStatementTerm (char *tline, SyntaxDe + if( tline[0] == COMMENTS_CHAR ) + return &_as_comments_term; + +- if( isspace(tline[0]) ) ++ if( isspace((unsigned char)tline[0]) ) + { + int i = 0; +- while( isspace(tline[i]) ) ++i; ++ while( isspace((unsigned char)tline[i]) ) ++i; + if( tline[i] == '~') + if( get_hash_item (syntax->term_hash, AS_HASHABLE(&tline[i]), &hdata.vptr)==ASH_Success ) + return hdata.vptr; +@@ -793,7 +793,7 @@ config2tree_storage (ConfigDef * config, + { + ++i; /* it's ok - we can start with 1, since myname should have at least 1 char */ + pterm = FindStatementTerm (&(config->tline[i]), config->syntax); +- }while( pterm == NULL && !isspace(config->tline[i]) && config->tline[i] != '\0' ); ++ }while( pterm == NULL && !isspace((unsigned char)config->tline[i]) && config->tline[i] != '\0' ); + }else + pterm = FindStatementTerm (config->tline, config->syntax); + +@@ -804,7 +804,7 @@ config2tree_storage (ConfigDef * config, + config->current_term = pterm; + + LOCAL_DEBUG_OUT("Term:[%s]", config->current_term->keyword); +- if( isspace(config->tline[0]) && pterm->keyword_len > 0 && ++ if( isspace((unsigned char)config->tline[0]) && pterm->keyword_len > 0 && + mystrncasecmp(pterm->keyword, config->current_data, pterm->keyword_len) == 0 ) + { /* we need to skip one token in current_data : */ + char *src = tokenskip( config->current_data, 1 ) ; diff --git a/wm/afterstep/patches/patch-libAfterStep_parser__xml.c b/wm/afterstep/patches/patch-libAfterStep_parser__xml.c new file mode 100644 index 00000000000..cf70acd8e6e --- /dev/null +++ b/wm/afterstep/patches/patch-libAfterStep_parser__xml.c @@ -0,0 +1,15 @@ +$NetBSD: patch-libAfterStep_parser__xml.c,v 1.1 2016/05/01 19:26:35 dholland Exp $ + +Use ctype.h correctly. + +--- libAfterStep/parser_xml.c~ 2006-07-18 17:36:36.000000000 +0000 ++++ libAfterStep/parser_xml.c +@@ -186,7 +186,7 @@ statement2xml_elem (ConfigDef * config) + }else if (get_flags(pterm->flags, TF_INDEXED)) + { + int i = 0 ; +- while( isdigit(ptr[i]) ) ++i; ++ while( isdigit((unsigned char)ptr[i]) ) ++i; + if( i > 0 ) + { + index = mystrndup(ptr, i); -- cgit v1.2.3