Репозиторий ALT Linux backports/2.4
Последнее обновление: 9 июля 2008 | Пакетов: 497 | Посещений: 1576350
 поиск   регистрация   авторизация 
 
Группа :: Графические оболочки/Icewm
Пакет: icewm

 Главная   Изменения   Спек   Патчи   Загрузить   Bugs and FR 

Патч: icewm.env-var-in-menu-prog-line.patch


diff -uNr icewm-1.0.2/conf.hp10 icewm-mod/conf.hp10
--- icewm-1.0.2/conf.hp10	Wed Dec 31 17:00:00 1969
+++ icewm-mod/conf.hp10	Wed Dec 15 10:58:12 1999
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+# HP-UX 11.0 config
+
+./configure --prefix=/apps/fw --with-imlib --without-xpm
+
+# Fixes:
+# Edited src/icewmbg.cc and commented out "#include <X11/xpm.h>"
+
diff -uNr icewm-1.0.2/conf.hp11 icewm-mod/conf.hp11
--- icewm-1.0.2/conf.hp11	Wed Dec 31 17:00:00 1969
+++ icewm-mod/conf.hp11	Mon Dec 13 16:49:50 1999
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+# HP-UX 11.0 config
+
+./configure --prefix=/apps/fw --x-includes=/apps/fw/X11R6.4/include \
+	--x-libraries=/apps/fw/X11R6.4/lib --with-x \
+	--with-imlib --without-xpm
+
+# Fixes:
+# Edited src/icewmbg.cc and commented out "#include <X11/xpm.h>"
+
diff -uNr icewm-1.0.2/src/Makefile icewm-mod/src/Makefile
--- icewm-1.0.2/src/Makefile	Sat Feb 19 09:10:04 2000
+++ icewm-mod/src/Makefile	Thu Feb 24 12:12:13 2000
@@ -33,7 +33,7 @@
 icewm_LIBS = \
 	$(CORE_LIBS) $(IMAGE_LIBS) $(GNOME_LIBS)
 icewm_OBJS = \
-        ymsgbox.o ydialog.o yurl.o \
+        ymsgbox.o ydialog.o yurl.o env.o \
         wmsession.o wmwinlist.o wmtaskbar.o wmwinmenu.o \
         wmdialog.o wmabout.o wmswitch.o wmstatus.o \
         wmoption.o wmaction.o \
diff -uNr icewm-1.0.2/src/env.cc icewm-mod/src/env.cc
--- icewm-1.0.2/src/env.cc	Wed Dec 31 17:00:00 1969
+++ icewm-mod/src/env.cc	Thu Feb 24 12:16:51 2000
@@ -0,0 +1,61 @@
+/* Clinton Work - November 29, 1999 - Expand environment variables. */
+
+#include "env.h"
+
+/*
+int main(int argc, char **argv)
+  {
+  char cmd[256];
+
+  if (argc < 2)
+    {
+    fprintf(stderr,"Syntax: env prog\n");
+    exit(1);
+    } 
+  strcpy(cmd,argv[1]);
+
+  printf("Before: %s\n",cmd);
+  printf("After: %s\n", envExpand(cmd) );
+  }
+*/
+
+/* 
+This function takes the given strings and expands any environment variables
+within it.
+*/
+char * envExpand(char *str)
+  {
+  char var[64], result[1024] = ""; 
+  char *cur = str, *name, *env, *add = result;
+  while (cur && *cur)
+   {
+   /* Start of environment variable. */
+   if ( (*cur == '$') && (*(cur+1) != '$') )
+     { 
+     name = var;
+     cur++;
+     /* Name must have alpha-num characters. */
+     while(*cur && isalpha(*cur))
+       { *name++ = *cur++; }
+     *name = '\0'; 
+/*     printf("name = %s\n",name); */
+     env = getenv(var);
+     /* If the env variable exists. */
+     if (env != NULL)
+       {
+       strcat(result,env);
+       add += strlen(env);
+       }
+     }
+   else if ( (*cur == '$') && (*(cur+1) == '$') )
+     { *add++ = '$'; cur +=2; continue; }
+
+   *add++ = *cur++;
+   }
+
+  *add = '\0';
+/*  printf("Result: %s\n",result); */
+  strcpy(str,result);
+  return(str);
+  }
+
diff -uNr icewm-1.0.2/src/env.h icewm-mod/src/env.h
--- icewm-1.0.2/src/env.h	Wed Dec 31 17:00:00 1969
+++ icewm-mod/src/env.h	Thu Feb 24 12:28:05 2000
@@ -0,0 +1,17 @@
+
+#ifndef FIX_ENV_H
+#define FIX_ENV_H
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include <strings.h>
+
+extern "C" {
+
+char * envExpand(char *str);
+
+}
+
+#endif
+
diff -uNr icewm-1.0.2/src/wmprog.cc icewm-mod/src/wmprog.cc
--- icewm-1.0.2/src/wmprog.cc	Sat Dec 11 09:14:22 1999
+++ icewm-mod/src/wmprog.cc	Thu Feb 24 12:12:13 2000
@@ -282,6 +282,8 @@
 #ifndef LITE
                 if (icons[0] != '-') icon = YIcon::getIcon(icons);
 #endif
+		envExpand(command);	
+	    
                 DProgram * prog =
                     DProgram::newProgram(name, icon,
                                          word[1] == 'e', word[1] == 'u' ? wmclass : 0,
 
design & coding: Vladimir Lettiev aka crux © 2004-2005