add cast to XtCalloc() call
[nedit-bw.git] / shell-in-help-output.patch
blob821f78d9884410f3debaad7b3376d5b53c480d7d
1 Subject: used shell in --version
3 Show the configured shell and the system default shell in the help output.
5 ---
7 source/help.c | 5 ++++-
8 source/preferences.c | 7 +++----
9 source/preferences.h | 1 +
10 3 files changed, 8 insertions(+), 5 deletions(-)
12 diff --quilt old/source/help.c new/source/help.c
13 --- old/source/help.c
14 +++ new/source/help.c
15 @@ -234,10 +234,12 @@ static const char *getBuildInfo(void)
16 " With Motif: %s%d.%d.%d [%s]\n"
17 "Running Motif: %d.%d [%s]\n"
18 " Server: %s %d\n"
19 " Visual: %s\n"
20 " Locale: %s\n"
21 + " NEdit Shell: %s\n"
22 + "Default Shell: %s\n"
25 static const char *visualClass[] = {"StaticGray", "GrayScale",
26 "StaticColor", "PseudoColor",
27 "TrueColor", "DirectColor"};
28 @@ -276,11 +278,12 @@ static const char *getBuildInfo(void)
29 xmUseVersion/1000, xmUseVersion%1000,
30 _XmVersionString,
31 (NULL == TheDisplay ? "<unknown>" : ServerVendor(TheDisplay)),
32 (NULL == TheDisplay ? 0 : VendorRelease(TheDisplay)),
33 visualStr,
34 - locale ? locale : "None");
35 + locale ? locale : "None",
36 + GetPrefShell(), GetDefaultShell());
38 if (stab == MotifKnownBad)
39 strcat(bldInfoString, warning);
41 atexit(freeBuildInfo);
42 diff --quilt old/source/preferences.c new/source/preferences.c
43 --- old/source/preferences.c
44 +++ new/source/preferences.c
45 @@ -1243,11 +1243,10 @@ static int caseReplace(char **inString,
46 static int stringReplace(char **inString, const char *expr,
47 const char *replaceWith, int searchType,
48 int replaceLen);
49 static int replaceMacroIfUnchanged(const char* oldText, const char* newStart,
50 const char* newEnd);
51 -static const char* getDefaultShell(void);
54 #ifdef SGI_CUSTOM
55 static int shortPrefToDefault(Widget parent, const char *settingName, int *setDefault);
56 #endif
57 @@ -1411,15 +1410,15 @@ static void translatePrefFormats(int con
58 PrefData.boldItalicFontString);
61 ** The default set for the comand shell in PrefDescrip ("DEFAULT") is
62 ** only a place-holder, the actual default is the user's login shell
63 - ** (or whatever is implemented in getDefaultShell()). We put the login
64 + ** (or whatever is implemented in GetDefaultShell()). We put the login
65 ** shell's name in PrefData here.
67 if (0 == strcmp(PrefData.shell, "DEFAULT")) {
68 - strncpy(PrefData.shell, getDefaultShell(), MAXPATHLEN);
69 + strncpy(PrefData.shell, GetDefaultShell(), MAXPATHLEN);
70 PrefData.shell[MAXPATHLEN] = '\0';
73 /* For compatability with older (4.0.3 and before) versions, the autoWrap
74 and autoIndent resources can accept values of True and False. Translate
75 @@ -6503,11 +6502,11 @@ void ChooseColors(WindowInfo *window)
77 ** This function passes up a pointer to the static name of the default
78 ** shell, currently defined as the user's login shell.
79 ** In case of errors, the fallback of "sh" will be returned.
81 -static const char* getDefaultShell(void)
82 +const char* GetDefaultShell(void)
84 struct passwd* passwdEntry = NULL;
85 static char shellBuffer[MAXPATHLEN + 1] = "sh";
87 passwdEntry = getpwuid(getuid()); /* getuid() never fails. */
88 diff --quilt old/source/preferences.h new/source/preferences.h
89 --- old/source/preferences.h
90 +++ new/source/preferences.h
91 @@ -147,10 +147,11 @@ char *GetPrefHelpFontName(int index);
92 char *GetPrefHelpLinkColor(void);
93 char *GetPrefColorName(int colorIndex);
94 void SetPrefColorName(int colorIndex, const char *color);
95 void SetPrefShell(const char *shell);
96 const char* GetPrefShell(void);
97 +const char* GetDefaultShell(void);
98 char *GetPrefGeometry(void);
99 char *GetPrefServerName(void);
100 char *GetPrefBGMenuBtn(void);
101 void RowColumnPrefDialog(Widget parent);
102 void TabsPrefDialog(Widget parent, WindowInfo *forWindow);