Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: aclemons/java-readline
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.8.3
Choose a base ref
...
head repository: aclemons/java-readline
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 72 additions and 38 deletions.
  1. +33 −0 .github/dependabot.yml
  2. +5 −4 .github/workflows/build.yml
  3. +13 −13 pom.xml
  4. +1 −1 src/native/getline.c
  5. +20 −20 src/native/org_gnu_readline_Readline.c
33 changes: 33 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
version: 2
updates:
- package-ecosystem: "maven"
directory: "/"
schedule:
interval: "weekly"
open-pull-requests-limit: 25
ignore:
- dependency-name: "org.apache.maven.plugins:maven-enforcer-plugin"
versions: [">=3.0.0"]
- dependency-name: "org.apache.maven.plugins:maven-clean-plugin"
versions: [">=3.2"]
- dependency-name: "org.apache.maven.plugins:maven-compiler-plugin"
versions: [">=3.9.0"]
- dependency-name: "org.apache.maven.plugins:maven-resources-plugin"
versions: [">=3.3.0"]
- dependency-name: "org.apache.maven.plugins:maven-site-plugin"
versions: [">=3.12.0"]
- dependency-name: "org.apache.maven.plugins:maven-project-info-reports-plugin"
versions: [">=3.3.0", "3.2.2"]
- dependency-name: "org.apache.maven.plugins:maven-install-plugin"
versions: [">=3.1.0"]
- dependency-name: "org.apache.maven.plugins:maven-surefire-plugin"
versions: [">=3.0.0"]
- dependency-name: "org.apache.maven.plugins:maven-jar-plugin"
versions: [">=3.3.0"]
- dependency-name: "org.codehaus.mojo:animal-sniffer-maven-plugin"
versions: [">=1.18"]
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
9 changes: 5 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -6,16 +6,17 @@ on:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-20.04
strategy:
matrix:
jdk: ['7', '8', '11', '17']
jdk: ['7', '8', '11', '17', '21']
cc: [gcc, clang]
os: [ubuntu-20.04, ubuntu-22.04]
runs-on: ${{ matrix.os }}
steps:
- name: Check out code
uses: actions/checkout@v2
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Set up JDK ${{ matrix.jdk }}
uses: actions/setup-java@v2
uses: actions/setup-java@8df1039502a15bceb9433410b1a100fbe190c53b # v4.5.0
with:
distribution: 'zulu'
java-version: ${{ matrix.jdk }}
26 changes: 13 additions & 13 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
<groupId>org.gnu</groupId>
<artifactId>libreadline-java</artifactId>
<packaging>jar</packaging>
<version>0.8.3</version>
<version>0.8.4-SNAPSHOT</version>
<name>java-readline</name>
<issueManagement>
<url>https://github.com/aclemons/java-readline/issues</url>
@@ -76,27 +76,27 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.4</version>
<version>3.5.0</version>
</plugin>
<plugin>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>2.9</version>
<version>3.2.1</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
<version>3.1.1</version>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
<version>3.0.1</version>
</plugin>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.0.0</version>
<version>3.1.0</version>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
<version>3.2.2</version>
<configuration>
<archive>
<manifest>
@@ -111,28 +111,28 @@
</plugin>
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
<version>3.2.0</version>
</plugin>
<plugin>
<artifactId>maven-site-plugin</artifactId>
<version>3.6</version>
<version>3.11.0</version>
</plugin>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.1</version>
<version>3.2.1</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.1</version>
<version>3.8.1</version>
<configuration>
<showDeprecation>true</showDeprecation>
<showWarnings>true</showWarnings>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.20</version>
<version>2.22.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
@@ -185,7 +185,7 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-maven-plugin</artifactId>
<version>1.15</version>
<version>1.17</version>
<executions>
<execution>
<id>check-java6</id>
2 changes: 1 addition & 1 deletion src/native/getline.c
Original file line number Diff line number Diff line change
@@ -982,7 +982,7 @@ char *p;
/* makes a copy of the string */
{
char *s = 0;
int len = strlen(p);
size_t len = strlen(p);
char *nl = strchr(p, '\n');

if (nl) {
40 changes: 20 additions & 20 deletions src/native/org_gnu_readline_Readline.c
Original file line number Diff line number Diff line change
@@ -130,18 +130,18 @@ static int* globalIntegerInternals[] = {
};

static char** globalStringInternals[] = {
/* const */ &rl_library_version,
/* const */ &rl_readline_name,
/* const */ (char**) &rl_library_version,
/* const */ (char**) &rl_readline_name,
&rl_prompt,
&rl_line_buffer,
/* const */ &rl_terminal_name,
/* const */ (char**) &rl_terminal_name,
&rl_executing_macro,
/* const */ &rl_basic_word_break_characters,
/* const */ &rl_completer_word_break_characters,
/* const */ &rl_completer_quote_characters,
/* const */ &rl_basic_quote_characters,
/* const */ &rl_filename_quote_characters,
/* const */ &rl_special_prefixes,
/* const */ (char**) &rl_basic_word_break_characters,
/* const */ (char**) &rl_completer_word_break_characters,
/* const */ (char**) &rl_completer_quote_characters,
/* const */ (char**) &rl_basic_quote_characters,
/* const */ (char**) &rl_filename_quote_characters,
/* const */ (char**) &rl_special_prefixes,

&history_word_delimiters,
&history_no_expand_chars,
@@ -198,18 +198,18 @@ static int* globalIntegerInternals[] = {
};

static char** globalStringInternals[] = {
/* const */ &rl_library_version,
/* const */ &rl_readline_name,
/* const */ (char**) &rl_library_version,
/* const */ (char**) &rl_readline_name,
&undefinedInternalString, /* &rl_prompt, */
&rl_line_buffer,
&undefinedInternalString, /* const &rl_terminal_name, */
&undefinedInternalString, /* &rl_executing_macro, */
/* const */ &rl_basic_word_break_characters,
/* const */ &rl_completer_word_break_characters,
/* const */ &rl_completer_quote_characters,
/* const */ (char**) &rl_basic_word_break_characters,
/* const */ (char**) &rl_completer_word_break_characters,
/* const */ (char**) &rl_completer_quote_characters,
&undefinedInternalString, /* const &rl_basic_quote_characters, */
&undefinedInternalString, /* const &rl_filename_quote_characters, */
/* const */ &rl_special_prefixes,
/* const */ (char**) &rl_special_prefixes,

&undefinedInternalString, /* &history_word_delimiters, */
&undefinedInternalString, /* &history_no_expand_chars, */
@@ -307,8 +307,8 @@ static size_t bufLength = 0;

static char* word_break_buffer = NULL;

static char* fromjstring(const JNIEnv *env, jstring value);
static jstring tojstring(const JNIEnv *env, const char* value);
static char* fromjstring(JNIEnv *const env, jstring value);
static jstring tojstring(JNIEnv *const env, const char* value);

static int allocBuffer(size_t n);

@@ -776,7 +776,7 @@ JNIEXPORT jstring JNICALL
/* Convert jstring to c-string */
/* -------------------------------------------------------------------------- */

char* fromjstring(const JNIEnv *env, jstring value) {
char* fromjstring(JNIEnv *const env, jstring value) {
const jclass jstringClass = (*env)->GetObjectClass(env, value);
const jmethodID getBytesMethodId = (*env)->GetMethodID(env, jstringClass, "getBytes", "()[B");

@@ -790,7 +790,7 @@ char* fromjstring(const JNIEnv *env, jstring value) {
return NULL;
}

const jbyte* bytes = (*env)->GetByteArrayElements(env, jstringJBytes, NULL);
jbyte *const bytes = (*env)->GetByteArrayElements(env, jstringJBytes, NULL);

if (2*length > bufLength) {
if (allocBuffer(2*length)) {
@@ -822,7 +822,7 @@ char* fromjstring(const JNIEnv *env, jstring value) {
/* Convert c-string to j-string */
/* -------------------------------------------------------------------------- */

jstring tojstring(const JNIEnv *env, const char* value) {
jstring tojstring(JNIEnv *const env, const char* value) {
const jclass jstringClass = (*env)->FindClass(env,"java/lang/String");
const jmethodID constructorMethodId = (*env)->GetMethodID(env, jstringClass, "<init>", "([B)V");